我找到了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。
发布于 2011-10-30 20:56:13
正如在输出中所说的,编译器忽略了#pragma comment指令。你必须使用link against libdevil.a manually。
https://stackoverflow.com/questions/7944906
复制相似问题