SOIL library , how to use

Hello,

Can anyone give me detailed instructions to use SOIL library ?

I am trying to use SOIL library to load image for the textures but my main program is not recognizing SOIL functions.

  1. I am moving all the files in my solution directory where my main.cpp also lives.
  2. Dragging all the header files in “Header files” folder of project.
  3. Dragging SOIL.c file in “Source files” folder of project.
  4. renaming libSOIL.a file to SOIL.lib and copying it to lib folder if Visual Studio.
  5. including SOIL.h in main.cpp

but still main.cpp can not find SOIL functions.

Thanks
Chayan

1 Like
  1. renaming libSOIL.a file to SOIL.lib and copying it to lib folder if Visual Studio.

If you’re using Visual Studio, how did you even get libsoil.a to begin with? Did you not compile it with VS?

In any case, you should have done none of those things. First and foremost, never touch anything inside of Visual Studio’s directories!

You should have built SOIL with Visual Studio. The download comes with Visual Studio projects. Then, in your actual project, add SOIL’s include path to the list of include directories (remember to do this for debug and release builds). Add the SOIL library (that you built with VS) to the list of libraries to include (one for debug and one for release). Then everything should work.

And people wonder why I use Premake in my tutorials…

1 Like