setting up DevIL

sorry if this is slightly off topic… but you guys seem to know everything opengl, or in this case opengl related…

so ive added DevIL “include” and “lib” directories to my MSVC 2008 express.

the documentation doesnt say, but ive added “DevIL.lib” to my project additonal dependencies field. (without it, it doesnt work)

then in my cpp… #include “IL/il.h”

-> i get a popup error saying “DevIL.dll” is not found

-> if i add this to my additonal dependencies field i get a compile error…

“DevIL.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x2A8”

if i take out devil.lib, i get the same thing

ive downloaded it twice and tried the 1.73 and 1.72 RC

same problem in both release and debug.

not sure what to do now… can anyone help?

thanks
james

i get an error

You are linking a “shared” library. The .lib is a stub, the actual implementation is found in DevIL.dll.

So windows must be able to find this file. You have 2 options. Put it in the same path as your executable. Which would be c:…\yourproject
Or you can add the location of DevIL.dll to system path. Control Panel -> System Settings -> Environment Variables

move devil.lib to the ‘additional library directories’ in the project settings->linker->General category.
In settings->linker->Input add devil.lib
then mov devil.lib to your project directory.

By the way… dvil it’s too old. managing states is very ugly. I recommend you to use FreeImage. Here is some GL-Freeimage sample code:

http://www.opengl.org/discussion_boards/…3307#Post233307

Good luck!

thanks for the help, free image looks interesting, i will check it out.