4

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?

4

2 回答 2

9
$ 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

因此,您可能希望在 g++ 命令行上使用以下内容

-I /usr/include/SOIL

或者只是在您的 C++ 中使用以下内容

#include <SOIL/SOIL.h>

链接时您可能希望在命令行上显示以下内容

-lSOIL
于 2013-05-11T01:34:50.820 回答
1

您可能需要添加 -I 编译器参数来告诉它在哪里可以找到 SOIL 头文件。

于 2013-05-11T01:03:36.220 回答