Sign in to follow this  
Zarathustra

openEXR

Recommended Posts

Zarathustra    122
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

Share this post


Link to post
Share on other sites
Zarathustra    122
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]

Share this post


Link to post
Share on other sites
ldeej    308
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

Share this post


Link to post
Share on other sites
Zarathustra    122
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 :/

Share this post


Link to post
Share on other sites
Crypter    748
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.

Share this post


Link to post
Share on other sites
Zarathustra    122
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 :)

Share this post


Link to post
Share on other sites
Zarathustra    122
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

Share this post


Link to post
Share on other sites
Zarathustra    122
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]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this