gpt4 book ai didi

c++ - Devil库使用中的错误

转载 作者:太空宇宙 更新时间:2023-11-04 14:20:40 24 4
gpt4 key购买 nike

我找到了 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。

最佳答案

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

关于c++ - Devil库使用中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7944906/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com