Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't use SOIL in linux mint

I am doing an assignment that requires me to use SOIL. I installed it using the command sudo apt-get install libsoil-dev, but when I try to compile my program, I get the following error:

textureMain.cpp:19:18: fatal error: SOIL.h: No such file or directory
compilation terminated.
textureParams.cpp:17:18: fatal error: SOIL.h: No such file or directory
compilation terminated.

Why am I not able to compile the program even though I installed SOIL?

like image 737
rurouniwallace Avatar asked Dec 27 '22 04:12

rurouniwallace


2 Answers

$ dpkg -L libsoil-dev |grep include
/usr/include
/usr/include/SOIL
/usr/include/SOIL/SOIL.h
/usr/include/SOIL/image_DXT.h
/usr/include/SOIL/image_helper.h
/usr/include/SOIL/stbi_DDS_aug.h
/usr/include/SOIL/stbi_DDS_aug_c.h
/usr/include/SOIL/stb_image_aug.h

So you probably want the following on the g++ command-line

-I /usr/include/SOIL

Or just use the following in your C++

#include <SOIL/SOIL.h>

And you probably want the following on the command-line when linking

-lSOIL
like image 137
Brent Bradburn Avatar answered Dec 28 '22 16:12

Brent Bradburn


You may need to add a -I compiler argument to tell it where to find the SOIL header files.

like image 28
brian beuning Avatar answered Dec 28 '22 16:12

brian beuning