As suggested on Compiling OpenGL SOIL on Ubuntu,
First download the SOIL.h header file from its website
http://www.lonesock.net/soil.html
Place the header file in your project directory and include it in your project file.
#include "SOIL.h"
After that you have to install the soil library to use -lSOIL. To install the library use the command
sudo apt-get install libsoil-dev
Now compile the project using gcc along with -lSOIL
And in case you face the error:
undefined reference to 'SOIL_load_OGL_texture'
then link libSOIL before linking libopengl32 while compilation,for example:
g++ -g source.cpp -lglu32 -lSOIL -lopengl32 -lfreeglut
(source: undefined reference to `SOIL_load_OGL_texture'? )
Partager