openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openexr-devel] Building OpenEXR 2.0.1 on Windows


From: Babak Khataee
Subject: [Openexr-devel] Building OpenEXR 2.0.1 on Windows
Date: Fri, 9 Aug 2013 18:12:27 +0100

Hey Folks!

We're trying to get OpenEXR 2.0.1 building on windows with Visual Studio 2010 and have come across a couple of problems getting the half library building correctly. I'm not sure if these are issues on other versions of Visual Studio but thought you might be interested nonetheless.

1) halfExports.h - The windows specific macro PLATFORM_WINDOWS isn't defined anywhere, so not all the symbols in half.h get exported/imported. This results in lots of trivial failures in HalfTest. For example in testArithmetic.cpp

h = 1 + 2;
assert(h == 3); 

h is -27.1875, although it crashes before it hits the assert. The only way to fix it is to define PLATFORM_WINDOWS, however..

2) Defining PLATFORM_WINDOWS results in build errors, e.g.

2>testFunction.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl half::setBits(unsigned short)" (address@hidden@@address@hidden) referenced in function "public: __cdecl halfFunction<float>::halfFunction<float><float (__cdecl*)(float)>(float (__cdecl*)(float),class half,class half,float,float,float,float)" (address@hidden@address@hidden@@address@hidden@ZVhalf@@address@hidden)
2>..\x64\Debug\HalfTest.exe : fatal error LNK1120: 1 unresolved externals

I think this is due to a couple of functions in half.h being declared as both inline and HALF_EXPORT. Removing HALF_EXPORT from these functions fixes the build errors and the tests.

Confusingly the OpenEXR/ChangeLog suggests that there shouldn't be a PLATFORM_WINDOWS macro.. 

'No more PLATFORM_WINDOWS or PLATFORM_WIN32, replace with proper standard Windows macros.  (Drew Hess)'

Will defining PLATFORM_WINDOWS effect behavior any where else ?

thanks!
Babak






reply via email to

[Prev in Thread] Current Thread [Next in Thread]