我希望能够将 devIL 库用于我正在处理的项目,但由于某些原因我无法正确设置它。在我的项目中,我有:
#include <IL/il.h>
#include <IL/ilu.h>
#include <IL/ilut.h>
如果我不调用任何 devIL 函数,那么该文件将无错误地编译。但是,一旦我包含
ilInit();
我明白了
undefined reference to `ilInit'
collect2: ld returned 1 exit status
我做错了什么?
编辑:我正在运行 Ubuntu 11.10
最佳答案
显然您包含了 header ,但没有链接二进制文件。对于 gcc,这可以使用 -l
-选项来完成。
关于c++ - 不能用 devIL 调用任何函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8339739/