Reputation: 229
I'm using Microsoft Visual studio 2013. Trying to import DevIL library to load image files i'm getting LNK1104 error: Cannot open file "IL/devil.lib"
My Source.h file which include DevIL libs in Project/Sources directory while the DevIL libs in Project/Sources/IL directory. Here is my code
#ifdef _WIN32
#pragma comment(lib, "IL/devil.lib")
#pragma comment(lib, "IL/ilu.lib")
#pragma comment(lib, "IL/ilut.lib")
#endif
Upvotes: 1
Views: 25739
Reputation: 195
You just need to add your path lib file to Additional Library Directories in VS. Right click on your project, select Properties/Linker/General, then aim to your lib file in Additional Library Directories path.
Upvotes: 10
Reputation: 15232
You either have to remove the directory, and use the linker settings to specify the directory;
#pragma comment(lib, "devil.lib")
or you can use a hackish way using __FILE__
:
#pragma comment(lib, __FILE__"\\..\\IL\\devil.lib")
Upvotes: 1