使用Devil库时出错

时间:2011-10-30 12:33:58

标签: c++ devil

我找到this tutorial,但是当我将代码复制到我的C ++项目时,会出现很多错误:

-------------- Build: Debug in Tekstury123 ---------------

Compiling: main.cpp
C:\Users\piotrek\Documents\CodeBlocks Projects\Tekstury123\main.cpp:7: warning: ignoring #pragma comment 
Linking console executable: bin\Debug\Tekstury123.exe
obj\Debug\main.o: In function `main':
C:/Users/piotrek/Documents/CodeBlocks Projects/Tekstury123/main.cpp:20: undefined reference to `_imp__ilInit@0'
C:/Users/piotrek/Documents/CodeBlocks Projects/Tekstury123/main.cpp:24: undefined reference to `_imp__ilLoadImage@4'
C:/Users/piotrek/Documents/CodeBlocks Projects/Tekstury123/main.cpp:34: undefined reference to `_imp__ilGetError@0'
C:/Users/piotrek/Documents/CodeBlocks Projects/Tekstury123/main.cpp:36: undefined reference to `_imp__ilGetString@4'
C:/Users/piotrek/Documents/CodeBlocks Projects/Tekstury123/main.cpp:39: undefined reference to `_imp__ilGetInteger@4'
C:/Users/piotrek/Documents/CodeBlocks Projects/Tekstury123/main.cpp:41: undefined reference to `_imp__ilGetData@0'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
6 errors, 1 warnings

如何修复此错误?你能帮帮我吗? 我使用Windows,Code :: Blocks。

1 个答案:

答案 0 :(得分:0)

您的编译器会忽略#pragma comment指令,就像输出中所说的那样。你必须link against libdevil.a manually