Still more issues with windows

456 views
Skip to first unread message

chris golchert

unread,
Apr 19, 2015, 6:49:45 PM4/19/15
to openvd...@googlegroups.com

I honestly had 2.x running but I wanted to jump to the 3.x update.   I believe the people working on OpenEXR just hate people in general but really hate windows users.  The older 'compiling openexr' webpages no longer work with the last few versions of OpenEXR.  I have followed the threads here on building OpenVDB but even they seem to be a crapshoot when openEXR is involved.   The only way I could get it to compile was to remove the dwacompression file from the build.

Now.... Is this needed for the Blosc compression with openVDB?  If so can we get something a little friendlier than makefiles generating headers?

I would SO much rather be fighting my coding errors than trying to get everyone else's crap working.

Steven Caron

unread,
Apr 19, 2015, 8:22:52 PM4/19/15
to openvd...@googlegroups.com
I am able to build OpenEXR and ILMBase from source on a Windows 7 64bit machine. I built using the 2.2 tag and their newer CMake build system. Also, I able able to build statically and link statically. From there I am able to build openvdb 3.x from source (without blosc at this time). I can build and pass the tests (after some changes), and all the applications (also after some small changes for gl/glfw stuffs).

Have you tried building from a tagged version of OpenEXR and use their new CMake build system?

Steven

chris golchert

unread,
Apr 20, 2015, 12:21:21 AM4/20/15
to openvd...@googlegroups.com

I'm seeing plenty of tags but the only "2.2" one I'm seeing is a "v2.2fixes"  I was using the master but I'm trying the "v2.2fixes" for this post....


So you were able to just run it through cmake and then compile with no problem?

 

----------------------------------------

Run though cmake and the ilmbase has no problem.  

 

Building ILMbase:

After changing the required stuff (static lib instead of dll/multithreaded/etc...)  It went though with no real complains.  There is way too much crap added to the solution that you can't change since "It has been generated but the build system."

Run though cmake and the OpenEXR has nothing but problems.


OpenEXR (after pointing it to the zlib folders) gives me a  "ILMBASE_PACKAGE_PREFIX ="   There isn't any info on that.  If I add that as an entry with the path it still complains about it.  

  When I tell it to generate I get a TON of warnings telling me:

WARNING: Target [various files] requests linking to directory "X:/VDB2015/libraries". Targets may link only to libraries. CMake is dropping the item.


Building Openexr:

This one is fun.  It seems to depend on the time of day and what I had to eat for lunch.  In addition to the vast amount of crap it adds to this solution it cam't seem to open half.lib most of the time.  A bunch of people online have said that this part of the source is really picky about library locations.  When I finial force half.lib down its throat I get linker errors most of the time one that. 


So given all of that you should be able misunderstand why I say they stopped supporting windows.


PS. I'm using VS GUI as the compiler because I'm coming from the content creation side and don't want to have to learn the cryptic nonsense of command line compiling and make utilities.

Steven Caron

unread,
Apr 20, 2015, 12:39:34 AM4/20/15
to openvd...@googlegroups.com
This is what I used...
https://github.com/openexr/openexr/tree/v2.2.0

I also use the Visual Studio IDE for compiling, I am a TD with no engineering background so I understand where you are coming from. A little more info about my configuration... I am using Visual Studio 2012 Express and when installing the ILMBase I use the default location "C:/Program Files/ILMBase". Then when compiling OpenEXR I point the "ILMBASE_PACKAGE_PREFIX" to that path. I also install OpenEXR to "C:/Program FIles/OpenEXR".

What version of Visual Studio are you using? I can share my precompiled binaries if that would help?

Steven

chris golchert

unread,
Apr 20, 2015, 7:05:33 PM4/20/15
to openvd...@googlegroups.com
That would be great, thanks.     

I am using 2012.


chris golchert

unread,
Apr 21, 2015, 10:22:37 PM4/21/15
to openvd...@googlegroups.com
Trying to figure out where the problem is now.


I have a file, called Source.cpp, that contains:

#include <openvdb/openvdb.h>
#include <iostream>
int main()
{
    openvdb::initialize();

return(0);
}

It compiles fine ( no real reason why it wouldn't). I get this on build:

1>Source.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static short __cdecl half::convert(int)" (__imp_?convert@half@@CAFH@Z)
1>OpenVDB.lib(openvdb.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static short __cdecl half::convert(int)" (__imp_?convert@half@@CAFH@Z)
1>Source.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static union half::uif const * const half::_toFloat" (__imp_?_toFloat@half@@0QBTuif@1@B)
1>OpenVDB.lib(openvdb.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static union half::uif const * const half::_toFloat" (__imp_?_toFloat@half@@0QBTuif@1@B)
1>Source.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static unsigned short const * const half::_eLut" (__imp_?_eLut@half@@0QBGB)
1>OpenVDB.lib(openvdb.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static unsigned short const * const half::_eLut" (__imp_?_eLut@half@@0QBGB)


What has me fried on this is half built "successfully" as did OpenVDB's library.

Rama Hoetzlein

unread,
Apr 22, 2015, 9:40:24 AM4/22/15
to openvd...@googlegroups.com
Fyi,
I am providing new forks of OpenVDB and OpenEXR, with update cmake find modules, better packaging, and code fixes to allow for easier Windows builds. Just follow the instructions given on this github repostiory:
    https://github.com/rchoetzlein/win_openvdb   

Best,
lithozine (R. Hoetzlein)

chris golchert

unread,
Apr 26, 2015, 9:23:39 PM4/26/15
to openvd...@googlegroups.com
After some help from some great people I now have a bunch of static libraries sitting in a folder.

The current problem is that the source posted above (just initializing openvdb) gives me:

Error 2026 error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl openvdb::v3_0_0::initialize(void)" (__imp_?initialize@v3_0_0@openvdb@@YAXXZ) X:\VDB2015\test\base\base\Source.obj


I never ran into that (or this much trouble) when I was playing with 2.x.    I really hate to have to nuke everything and start over but I'm not really sure if a library is compiling but is getting runtime issues linked in.

Steven Caron

unread,
Apr 26, 2015, 11:47:32 PM4/26/15
to openvd...@googlegroups.com
are you creating a visual studio project by hand or using cmake?

what are your linker flags?

s

chris golchert

unread,
Apr 27, 2015, 6:50:25 PM4/27/15
to openvd...@googlegroups.com
This issue was with all the (static) libraries in place and just trying to build:

Oleg Bliznuk

unread,
Apr 27, 2015, 7:43:35 PM4/27/15
to openvd...@googlegroups.com
hey chris,
if i recall correctly, i had that error too, because one of missing preprocessor definitions
i have compiled (vs2013) ilmbase with

PLATFORM_WINDOWS
PLATFORM_BUILD_STATIC
HALF_EXPORTS

and the vdb lib itself with

OPENVDB_STATICLIB
PLATFORM_WINDOWS
PLATFORM_BUILD_STATIC
HALF_EXPORTS
OPENVDB_OPENEXR_STATICLIB

-oleg

Vincent tan Sin chia

unread,
Apr 27, 2015, 11:25:29 PM4/27/15
to openvd...@googlegroups.com
Hi Chris,

I am getting the same errors as yours, have you solved the problems yet??

Thanks.



Best,
Vincent



Steven Caron

unread,
Apr 27, 2015, 11:36:39 PM4/27/15
to openvd...@googlegroups.com
if you are linking statically you need to add some preprocessor definitions... look at oleg post.

Vincent tan Sin chia

unread,
Apr 27, 2015, 11:46:59 PM4/27/15
to openvd...@googlegroups.com
Hi Steven,

Do you mean that i have to add those preprocessor defintions before i build those libraries out??

Thanks a lot.



Best,
Vincent

Steven Caron

unread,
Apr 28, 2015, 12:07:43 AM4/28/15
to openvd...@googlegroups.com
if i have been following correctly, the windows builds rama provided are building statically already.

so just start by adding those definitions to your project

Vincent tan Sin chia

unread,
Apr 28, 2015, 1:11:43 AM4/28/15
to openvd...@googlegroups.com
Hi Steven,

Just to clarify, 
From what i read from Oleg post, the preprocessor definition is added to the solution of Ilmbase and OpenVDB respectively right before building out the library. 
For now, i have already had those openvdb.lib and other accompanying dlls built out; but unfortunately getting the errors as encountered by Chris during building of example of Hello World from OpenVDB cookbook.
So, my question is that, do i need to add those preprocessor defintion in the project where the example of Hello World lies in??

Thanks a lot.



Regards,
Vincent

Steven Caron

unread,
Apr 28, 2015, 1:17:54 AM4/28/15
to openvd...@googlegroups.com
yes, to the 'Hello World' project... again this is assuming all the previous dependices are built correctly.

for my project i have added this to my cmake...

add_definitions(-DOPENVDB_STATICLIB -DNOMINMAX -DHALF_EXPORTS)

s

Vincent tan Sin chia

unread,
Apr 28, 2015, 1:27:49 AM4/28/15
to openvd...@googlegroups.com
Hi Steven,

One more newbie question from me as i have no experience in dealing with preprocessor, where do we place the prepocessor definition??
Right now, i am adding it to the C/C++ -> Preprocessor Definitions, so, i wonder whether it is correct or not as i still get the error.

Thanks


Vincent

Steven Caron

unread,
Apr 28, 2015, 1:40:12 AM4/28/15
to openvd...@googlegroups.com
show us what you typed in there... should be something like this.

/DOPENVDB_STATICLIB

Vincent tan Sin chia

unread,
Apr 28, 2015, 1:45:00 AM4/28/15
to openvd...@googlegroups.com
Hi Steven,

WIN32
NDEBUG
_CONSOLE
DOPENVDB_STATICLIB
DNOMINMAX
DHALF_EXPORTS



Vincent

Vincent tan Sin chia

unread,
Apr 28, 2015, 1:53:40 AM4/28/15
to openvd...@googlegroups.com
Hi Steven,

This is from the command line under C/C++

/Zi /nologo /W3 /WX- /O2 /Oi /GL /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "/DOPENVDB_STATICLIB" /D "DNOMINMAX" /D "DHALF_EXPORTS" /D "_UNICODE" /D "UNICODE" /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fp"x64\Release\vdb2010.pch" /Fa"x64\Release\" /Fo"x64\Release\" /Fd"x64\Release\vc100.pdb" /Gd /errorReport:queue

Thanks.

Vincent

Oleg Bliznuk

unread,
Apr 28, 2015, 4:36:37 AM4/28/15
to openvd...@googlegroups.com
not sure why there is "D" before all the definitions, maybe cmake replaces it ( i am not using cmake here because of broken ilm stuff as Rama said ), but anyway go to ...openvdb/platformconfig.h and make sure that "  #define OPENVDB_DLL" and  #define OPENEXR_DLL" became undefined

-oleg

Vincent tan Sin chia

unread,
Apr 28, 2015, 5:26:01 AM4/28/15
to openvd...@googlegroups.com
Hi Oleg,

I have followed your instruction and added in the preprocessor definition as guided by Steven as well, but after trying to run the hello world example of openvdb, i encountered errors as below which involves half.lib.
Any ideas why these happen??

main.obj : error LNK2001: unresolved external symbol "private: static union half::uif const * const half::_toFloat" (?_toFloat@half@@0QBTuif@1@B)
main.obj : error LNK2001: unresolved external symbol "private: static unsigned short const * const half::_eLut" (?_eLut@half@@0QBGB)

Thanks


Best
Vincent

Oleg Bliznuk

unread,
Apr 28, 2015, 6:26:04 AM4/28/15
to openvd...@googlegroups.com
Hi Vincent,

have you compiled ilmbase.lib with these definitions (and openvdb lib based on such compiled lib) ?
PLATFORM_WINDOWS
PLATFORM_BUILD_STATIC
HALF_EXPORTS
given these defs i assume to see "halfExport.h" header like this(see the attach pic)

regards,
Oleg
a763a542e0f62c7aeafc4a4a858a096f.png

Vincent tan Sin chia

unread,
Apr 28, 2015, 8:41:20 PM4/28/15
to openvd...@googlegroups.com
Hi Oleg,

As i am generating the IlmBase solution using Cmake by Rama, do i have to put in the same definition for all underlying project or i can just specify the preprocessor definition to only half and elut project??


Thanks Oleg.


Vincent

Vincent tan Sin chia

unread,
Apr 28, 2015, 9:22:40 PM4/28/15
to openvd...@googlegroups.com
Hi Oleg,

After i changed the preprocessor definition of halfExport as you did, my project couldn't generate half.lib which is the dependency of other project such as Imath thus resulting in failure of building of Imath.
Any ideas on this??

Thanks Oleg.

Vincent

chris golchert

unread,
May 10, 2015, 7:33:33 PM5/10/15
to openvd...@googlegroups.com
I'm really starting to wonder if a windows update messed up the system.  I can get a compile on everything except render.  That is just crapping out because of glew.

I'm still trying to just get a working executable that just initializes openvdb.  At best I still get linker errors.

The precompiled version I was given will first complain that tbb.dll isn't on the system (it is.)  After canceling it will stop running the exe.  When I try to run it again is never complains about that but gives me:

  The procedure entry point LoadPackagedLibrary could not be located in the dynamic link library KERNEL32.dll

chris golchert

unread,
May 11, 2015, 8:55:09 PM5/11/15
to openvd...@googlegroups.com
I got hello world to compile but I'm still getting the kernel32.dll error.

Could someone try running the file?


This is just the hello world code from the cookbook.  Virus check and sandbox all you want.... Just please let me know if you get the same error or if it runs.

Reply all
Reply to author
Forward
0 new messages