简体   繁体   中英

Errors in the use of the Devil libraries

I found this tutorial , but when I copy code to my C++ project, there are many errors:

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

How can I fix this errors? Can you help me?
I use Windows, Code::Blocks.

Your compiler ignores #pragma comment directive, as it's said in the output. You have to link against libdevil.a manually .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM