i have encountered problems below:
error lnk2001: unresolved external symbol "__declspec(dllimport) const openvdb::v3_0_0::tree::treebase::`vftable'" (__imp_??_7treebase@tree@v3_0_0@openvdb@@6b@) 1>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>main.obj : error lnk2001: unresolved external symbol "__declspec(dllimport) int __cdecl openvdb::v3_0_0::util::printbytes(class std::basic_ostream<char,struct std::char_traits<char> > &,unsigned __int64,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,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>main.obj : error lnk2001: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl openvdb::v3_0_0::metadata::isregisteredtype(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?isregisteredtype@metadata@v3_0_0@openvdb@@sa_naebv?$basic_string@du?$char_traits@d@std@@v?$allocator@d@2@@std@@@z) 1>main.obj : error lnk2001: unresolved external symbol "__declspec(dllimport) public: static class boost::shared_ptr<class openvdb::v3_0_0::metadata> __cdecl openvdb::v3_0_0::metadata::createmetadata(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__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>main.obj : error lnk2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl openvdb::v3_0_0::math::transform::print(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)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>main.obj : error lnk2001: unresolved external symbol "__declspec(dllimport) void __cdecl openvdb::v3_0_0::initialize(void)" (__imp_?initialize@v3_0_0@openvdb@@yaxxz)
codes:
#include <openvdb/openvdb.h> #include <iostream> #pragma comment(lib,"openvdb.lib") int main() { // initialize openvdb library. must called @ least // once per program , may safely called multiple times. openvdb::initialize(); // create empty floating-point grid background value 0. openvdb::floatgrid::ptr grid = openvdb::floatgrid::create(); std::cout << "testing random access:" << std::endl; // accessor coordinate-based access voxels. openvdb::floatgrid::accessor accessor = grid->getaccessor(); // define coordinate large signed indices. openvdb::coord xyz(1000, -200000000, 30000000); // set voxel value @ (1000, -200000000, 30000000) 1. accessor.setvalue(xyz, 1.0); // verify voxel value @ (1000, -200000000, 30000000) 1. std::cout << "grid" << xyz << " = " << accessor.getvalue(xyz) << std::endl; // reset coordinates of different voxel. xyz.reset(1000, 200000000, -30000000); // verify voxel value @ (1000, 200000000, -30000000) // background value, 0. std::cout << "grid" << xyz << " = " << accessor.getvalue(xyz) << std::endl; // set voxel value @ (1000, 200000000, -30000000) 2. accessor.setvalue(xyz, 2.0); // set voxels @ 2 extremes of available coordinate space. // 32-bit signed coordinates these (-2147483648, -2147483648, -2147483648) // , (2147483647, 2147483647, 2147483647). accessor.setvalue(openvdb::coord::min(), 3.0f); accessor.setvalue(openvdb::coord::max(), 4.0f); std::cout << "testing sequential access:" << std::endl; // print active ("on") voxels means of iterator. (openvdb::floatgrid::valueonciter iter = grid->cbeginvalueon(); iter; ++iter) { std::cout << "grid" << iter.getcoord() << " = " << *iter << std::endl; } }
fyi, have built openvdb.lib file using guidelines rama in openvdb forum. however, when try build hello world example below, complains linker errors. have included include directories library directories , specify #pragma comment include openvdb.lib.
fyi, built openvdb library static library built out vs2010.
thus, can know possibly gone wrong or maybe way using wrong??
according this website, need include following files in project (add them in project options/linker/input)
glew32d.lib glu32.lib opengl32.lib glfw.lib zlibstat.lib half.lib
then seems need change option:
add /force:multiple command line linker options under linker > command line
this should right settings compile test project.