Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot open file 'SOIL.libkernel32.lib'

I need use SOIL library in my project. My steps:

  1. download and extract zip to my project folder

  2. rename libSOIL.a to SOIL.lib

  3. Properties >> C/C++>General >> Additional include directories - Add "./SOIL/src"

  4. Properties >> Linker >> General >> Additional Library Directories - Add "SOIL.lib"

  5. put #include "SOIL.h"

Function *SOIL_load_image* was found but

error LNK1104: cannot open file 'SOIL.libkernel32.lib'

like image 505
Hricer Avatar asked Dec 02 '22 17:12

Hricer


1 Answers

I know this question is a couple weeks old now, but I figured it can't hurt.

The actual error you are getting is (probably) because you are missing a semicolon in the list of libraries to link.

If you go to Properties -> Linker -> Input -> Additional Dependencies (which I assume you must have gone to, though it isn't in your list of steps), it should say something like SOIL.lib%(AdditionalDependencies).

If you change that to SOIL.lib;%(AdditionalDependencies) (note the semicolon!), then that error should disappear.

What %(AdditionalDependencies) does is append some other libraries that Microsoft knows (or thinks) that you will need. The first of those is kernel.lib, so without a semicolon to seperate your SOIL.lib and kernel.lib, the linker tries to find SOIL.libkernel.lib, which does not exist!!

like image 125
Numeri Avatar answered Dec 10 '22 03:12

Numeri