openEXR

Started by
8 comments, last by Zarathustra 16 years, 1 month ago
Easy question basically can someone run me through getting this to work on a windows machine (XP) using Visual studio 2005 express. I downloaded the precompiled dll's for the 2005 edition and I get the includes right (that's not that hard). But when I do something simple like readGZ1 (const char fileName[], Array2D<half> &rPixels, Array2D<half> &gPixels, Array2D<float> &zPixels, int &width, int &height) { InputFile file (fileName); } I get 5 linking errors from that 1 line of code Linking... main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Imf::InputFile::~InputFile(void)" (??1InputFile@Imf@@UAE@XZ) referenced in function "void __cdecl readGZ1(char const * const,class Imf::Array2D<class half> &,class Imf::Array2D<class half> &,class Imf::Array2D<float> &,int &,int &)" (?readGZ1@@YAXQBDAAV?$Array2D@Vhalf@@@Imf@@1AAV?$Array2D@M@2@AAH3@Z) main.obj : error LNK2019: unresolved external symbol "public: __thiscall Imf::InputFile::InputFile(char const * const,int)" (??0InputFile@Imf@@QAE@QBDH@Z) referenced in function "void __cdecl readGZ1(char const * const,class Imf::Array2D<class half> &,class Imf::Array2D<class half> &,class Imf::Array2D<float> &,int &,int &)" (?readGZ1@@YAXQBDAAV?$Array2D@Vhalf@@@Imf@@1AAV?$Array2D@M@2@AAH3@Z) main.obj : error LNK2019: unresolved external symbol "int __cdecl Imf::globalThreadCount(void)" (?globalThreadCount@Imf@@YAHXZ) referenced in function "void __cdecl readGZ1(char const * const,class Imf::Array2D<class half> &,class Imf::Array2D<class half> &,class Imf::Array2D<float> &,int &,int &)" (?readGZ1@@YAXQBDAAV?$Array2D@Vhalf@@@Imf@@1AAV?$Array2D@M@2@AAH3@Z) MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup C:\Documents and Settings\Peter\Mijn documenten\Visual Studio 2005\Projects\envmap\Debug\envmap.exe : fatal error LNK1120: 4 unresolved externals Build log was saved at "file://c:\Documents and Settings\Peter\Mijn documenten\Visual Studio 2005\Projects\envmap\envmap\Debug\BuildLog.htm" envmap - 5 error(s), 0 warning(s) ------------------------------------------ Then I also tried to build the 1.6.0 version myself but just trying to build the ilmbase with VS2005 express won't work. So I'm kinda in a pickle here :/ Help is very much appreciated
Advertisement
You aren't linking against the OpenEXR libraries lib file.
apparently I'm not indeed :)

But I tried adding IlmImf.lib, Imath.lib, Iex.lib, Half.lib etc at the command line of the linker but then he complains he can't find them.

But I added the directories where they are to be found at VC ++ directories for include/libraries. So I'm kinda confused as to where I should be adding stuff.

So I know it's a stupid question but if someone could give me a play by play on how to set it up it would be appreciated. Apparently I'm doing forgetting something obvious.

edit:

at my linker command line it says this


/OUT:"C:\Documents and Settings\Peter\Mijn documenten\Visual Studio 2005\Projects\envmap\Debug\envmap.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\envmap.exe.intermediate.manifest" /DEBUG /PDB:"c:\Documents and Settings\Peter\Mijn documenten\Visual Studio 2005\Projects\envmap\debug\envmap.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 /ERRORREPORT:PROMPT kernel32.lib

I guessing that the other libs should be mentioned here too

[Edited by - Zarathustra on February 29, 2008 7:46:34 PM]
make sure you add the directory where the openEXR libs live by doing the following:

- Right click on your project on the Visual Studio Solution tree
- Click on Properties
- Select Configuration Properties->Linker->General
- Add the directory where your libraries lib to the "Additional Library Directories" field

k, so I managed to compile openEXR 1.6.0 and I get this direcory structure
Deploy
lib
include
bin

Then I did what ideej said and I get this at the commandline of the linker

/OUT:"C:\Documents and Settings\Peter\Mijn documenten\Visual Studio 2005\Projects\environmentmapping\Debug\environmentmapping.exe" /INCREMENTAL /NOLOGO /LIBPATH:"C:\Deploy\lib\Release" /MANIFEST /MANIFESTFILE:"Debug\environmentmapping.exe.intermediate.manifest" /DEBUG /PDB:"c:\documents and settings\peter\mijn documenten\visual studio 2005\projects\environmentmapping\debug\environmentmapping.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 /ERRORREPORT:PROMPT kernel32.lib


C:\Deploy\lib\Release is where the libraries are to be found

still not working tho :/
Quote:
MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

Insure you compile the program as a Win32 application, not a console application.

In the MSVC++ 2005 IDE...

go to project properties->Linker->System->SubSystem, and change the subsystem to /SUBSYSTEM:WINDOWS

Then, completely clean and rebuild your project (Both options are under the Build menu)

Quote:
C:\Deploy\lib\Release is where the libraries are to be found

Are you building this in debug build or release build? Insure you do not mix library types...

Finally, it looks like you are only linking kernel32.lib. Follow ldeej's instructions after resolving the above problems, and it should work fine.
Quote:Original post by Crypter
Quote:
MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

Insure you compile the program as a Win32 application, not a console application.

In the MSVC++ 2005 IDE...

go to project properties->Linker->System->SubSystem, and change the subsystem to /SUBSYSTEM:WINDOWS

Then, completely clean and rebuild your project (Both options are under the Build menu)


I already solved that problem by adding a mainfunction.

Quote:Original post by Crypter
Quote:
C:\Deploy\lib\Release is where the libraries are to be found

Are you building this in debug build or release build? Insure you do not mix library types...

Finally, it looks like you are only linking kernel32.lib. Follow ldeej's instructions after resolving the above problems, and it should work fine.



I just build it in release now. So I should let him look for the .lib files right? Which I just did like ideej said. I added Deploy\lib to the additional libraries. But I still get this.

Linking...
main.obj : error LNK2001: unresolved external symbol "int __cdecl Imf::globalThreadCount(void)" (?globalThreadCount@Imf@@YAHXZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall Imf::InputFile::~InputFile(void)" (??1InputFile@Imf@@UAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall Imf::InputFile::InputFile(char const * const,int)" (??0InputFile@Imf@@QAE@QBDH@Z)


edit: it's 3 o'clock at night here so I'm heading to bed. already appreciating all the help tho :)
k, so to clarify the matter I made some screenshots

screenshots here

map and map2 show my directory structure
optionsGeneral show the overall msvc options
optionsProject show the linker options, which I've set like ideej told me
mistery solved, I'm officially an idiot >_>

In the linker options I had put Imath.lib, Iex.lib, Half.lib but it has to be Imath.lib Iex.lib Half.lib Ergo without the comma's

Well thanks for the help anyway :p
yet the troubles continue

I can now compile the simple code I pasted above (to release)
but now I get this when I run it from visual studio it crashes
when i run it from commandline it works, very weird. But not really a problem atm

anyway my real question would be: any hints on how I can read out actual RGB values to lets say a text file or maybe a .dat file ?

[Edited by - Zarathustra on March 1, 2008 5:39:49 PM]

This topic is closed to new replies.

Advertisement