Hi Andreas, That error is a link-time error which is very different from whether or not the conversion would work or not (a compile time or run time error). Your assignment is correct but the linker is telling you you referred to some data you forget to add to the link line. Obviously your code doesn't directly refer to something called half::_toFloat, it has been hidden from view by the C++ class half. The compiler though, knew all about this and if you dig through the headers files you'd find it.
So how do you remedy this? Well you have either just missed a .lib file from the link line or you have ended up building openexr incorrectly. Lets hopes it's the former, you can list all the symbols a .lib file exports with the command line tool dumpbin: C:\> dumpbin -exports Half.lib Half.lib is where half::_toFloat should be defined :-) - James PS ?_toFloat@half@@0QBTuif@1@B is the the compiler's name for the same symbol, google c++ name mangling On May 31, 2012, at 3:02 AM, Zindel, Andreas wrote: > Hi, > > I'm trying to use the OpenExr library in my application to get the pixel > data of an exr-file. I built the library based on the instructions with > Visual Studio 2005. The test program I wrote can access the exr-file and > get the data of the pixel as half values. Now when I try to convert the > half values into float (which I need for the next step of the > processing) like this: > > half a = newPixels[i][j].r; > float b = a; > > I get the following error message from Visual Studio that says: > > OpenExrReader.obj : error LNK2001: unresolved external symbol "private: > static union half::uif const * const half::_toFloat" > (?_toFloat@half@@0QBTuif@1@B) > > The conversion from half to float should work this way accordingly to > the OpenExr doc. > > Does anyone know how to solve this problem? > > Greetings > > _______________________________________________ > Openexr-devel mailing list > Openexr-devel@nongnu.org > https://lists.nongnu.org/mailman/listinfo/openexr-devel _______________________________________________ Openexr-devel mailing list Openexr-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/openexr-devel