title: Compiling Hello World example from OpenVDB
body: <p>i have encountered some problems as below:</p>
  
  <pre><code>error LNK2001: unresolved external symbol "__declspec(dllimport) const openvdb::v3_0_0::tree::TreeBase::`vftable'" (__imp_??_7TreeBase@tree@v3_0_0@openvdb@@6B@)
  1&gt;main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl openvdb::v3_0_0::GridBase::saveFloatAsHalf(void)const " (__imp_?saveFloatAsHalf@GridBase@v3_0_0@openvdb@@QEBA_NXZ)
  1&gt;main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) int __cdecl openvdb::v3_0_0::util::printBytes(class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,unsigned __int64,class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;,class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;,bool,int,int)" (__imp_?printBytes@util@v3_0_0@openvdb@@YAHAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@_KAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@2_NHH@Z)
  1&gt;main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl openvdb::v3_0_0::Metadata::isRegisteredType(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;)" (__imp_?isRegisteredType@Metadata@v3_0_0@openvdb@@SA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  1&gt;main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class boost::shared_ptr&lt;class openvdb::v3_0_0::Metadata&gt; __cdecl openvdb::v3_0_0::Metadata::createMetadata(class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;)" (__imp_?createMetadata@Metadata@v3_0_0@openvdb@@SA?AV?$shared_ptr@VMetadata@v3_0_0@openvdb@@@boost@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
  1&gt;main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl openvdb::v3_0_0::math::Transform::print(class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; const &amp;)const " (__imp_?print@Transform@math@v3_0_0@openvdb@@QEBAXAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@6@@Z)
  1&gt;main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl openvdb::v3_0_0::initialize(void)" (__imp_?initialize@v3_0_0@openvdb@@YAXXZ)
  </code></pre>
  
  <p>Codes:</p>
  
  <pre><code>#include &lt;openvdb/openvdb.h&gt;
  #include &lt;iostream&gt;
  
  #pragma comment(lib,"openvdb.lib")
  int main()
  {
      // Initialize the OpenVDB library.  This must be called at least
      // once per program and may safely be called multiple times.
      openvdb::initialize();
      // Create an empty floating-point grid with background value 0. 
      openvdb::FloatGrid::Ptr grid = openvdb::FloatGrid::create();
      std::cout &lt;&lt; "Testing random access:" &lt;&lt; std::endl;
      // Get an accessor for coordinate-based access to voxels.
      openvdb::FloatGrid::Accessor accessor = grid-&gt;getAccessor();
      // Define a coordinate with large signed indices.
      openvdb::Coord xyz(1000, -200000000, 30000000);
  
      // Set the voxel value at (1000, -200000000, 30000000) to 1.
      accessor.setValue(xyz, 1.0);
  
      // Verify that the voxel value at (1000, -200000000, 30000000) is 1.
      std::cout &lt;&lt; "Grid" &lt;&lt; xyz &lt;&lt; " = " &lt;&lt; accessor.getValue(xyz) &lt;&lt; std::endl;
  
      // Reset the coordinates to those of a different voxel.
      xyz.reset(1000, 200000000, -30000000);
  
      // Verify that the voxel value at (1000, 200000000, -30000000) is
      // the background value, 0.
      std::cout &lt;&lt; "Grid" &lt;&lt; xyz &lt;&lt; " = " &lt;&lt; accessor.getValue(xyz) &lt;&lt; std::endl;
  
      // Set the voxel value at (1000, 200000000, -30000000) to 2.
      accessor.setValue(xyz, 2.0);
      // Set the voxels at the two extremes of the available coordinate space.
      // For 32-bit signed coordinates these are (-2147483648, -2147483648, -2147483648)
      // and (2147483647, 2147483647, 2147483647).
      accessor.setValue(openvdb::Coord::min(), 3.0f);
      accessor.setValue(openvdb::Coord::max(), 4.0f);
      std::cout &lt;&lt; "Testing sequential access:" &lt;&lt; std::endl;
      // Print all active ("on") voxels by means of an iterator.
      for (openvdb::FloatGrid::ValueOnCIter iter = grid-&gt;cbeginValueOn(); iter; ++iter) {
          std::cout &lt;&lt; "Grid" &lt;&lt; iter.getCoord() &lt;&lt; " = " &lt;&lt; *iter &lt;&lt; std::endl;
      }
  }
  </code></pre>
  
  <p>FYI, i have built the openvdb.lib file using guidelines from Rama in OpenVDB forum. However, when i try to build the hello world example as below, it complains about linker errors. I have included the include directories as well as library directories and even specify #pragma comment to include the openvdb.lib.</p>
  
  <p>FYI, the built OpenVDB library is a static library built out from VS2010.</p>
  
  <p>Thus, can i know what possibly gone wrong or maybe the way i am using it is wrong??</p>