I am testing the OpenVDB so here the steps I done to compile the helloworld in the VisualStudio 2010
1)
Download openexr ilmbase 1.02
Download tbb41
Download zlib-1.2.7
Download boost 1_53
2)
Create a new console project in VisualStudio 2010
with this main cpp code
//Microsoft Bugs on VC2010
#ifdef _DLL
#undef _DLL
#endif
#include <openvdb/openvdb.h>
#include <iostream>
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
openvdb::FloatGrid::Ptr grid = openvdb::FloatGrid::create();
std::cout<<"Testing Random Access: "<<std::endl;
openvdb::FloatGrid::Accessor accessor = grid->getAccessor();
openvdb::Coord xyz(1000, -20000, 300000);
accessor.setValue(xyz, 1.0);
std::cout<<"Grid"<< xyz << "=" << accessor.getValue(xyz) << std::endl;
return 0;
}
these are the other source files
<openvdb/Grid.cc>
<openvdb/io/Archive.cc>
<openvdb/io/Compression.cc>
<openvdb/io/File.cc>
<openvdb/io/GridDescriptor.cc>
<openvdb/io/Stream.cc>
<openvdb/math/Hermite.cc>
<openvdb/math/Maps.cc >
<openvdb/math/Proximity.cc>
<openvdb/math/QuantizedUnitVec.cc >
<openvdb/math/Transform.cc >
<openvdb/metadata/Metadata.cc >
<openvdb/metadata/MetaMap.cc >
<openvdb/Platform.cc >
<openvdb/util/Formats.cc >
<openvdb/util/Util.cc >
3) into the OpenVDB file types.h I changed the line
#include <OpenEXS/half.h>
into
#include <Half/half.h> //Denis 06/03/2012
4) add the define NOMINMAX into the project to avoid incompatibility of min max define
5) add the #undefine _DLL due to the bug of visual studio for console projects
6)
in crtdef.h of Visual Studio insert these lines to solve the problem of console projects
//Denis 07/03/2013
#ifdef _CONSOLE
#undef _DLL
#endif
7) compile the static zlib end add the link to that library
8) add the define ZLIB_WINAPI for the zlib
9) add to the sources the file half.cpp of the ilmbase
10) in platform.h I changed the define of OPENEXR_DLL to allow a static inclusion of half.cpp
// Windows build currently links to the shared Half.dll
#ifdef _WIN32
//Denis 08/03/2013
#ifndef _CONSOLE
#define OPENEXR_DLL 1
#endif
#endif
11) copy tbb_debug.dll in the debug folder of openvdbhelloworld
I hope this can help who want to make test in windows .
Suggestions are welcome.
Denis.