在 Codelite 中链接 SFML,找不到库

Linking SFML in Codelite, cannot find libraries

我正在尝试 linkCodelite 9.1.3 中的 SFML2.3.1。我正在使用 Windows 10、64 位。我根据本教程 http://en.sfml-dev.org/forums/index.php?topic=18820.0. I did the Include Paths, the Library Paths, entered the libraries including the dependencies in the correct order. A lot of other people have asked similar questions and I've tried all the solutions offered there- 和其他几个人做了所有事情。这是我得到的错误:

C:\WINDOWS\system32\cmd.exe /C C:/TDM-GCC-64/bin/mingw32-make.exe -j8 SHELL=cmd.exe -e -f  Makefile
"----------Building project:[ CodeLiteProject - Debug ]----------"
mingw32-make.exe[1]: Entering directory 'C:/Users/Benjamin/Documents/sfml/CodeLiteProject'
C:/TDM-GCC-64/bin/g++.exe -o ./Debug/CodeLiteProject @"CodeLiteProject.txt" -L. -LC:/SFML-2.3.1/lib  -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -lsfml-audio-s -lsfml-network-s -lopengl32 -lfreetype -ljpeg -lwinmm -lgdi32 -lopenal32 -lws2_32
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/SFML-2.3.1/lib/libsfml-graphics-s.a when searching for -lsfml-graphics-s
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/SFML-2.3.1/lib\libsfml-graphics-s.a when searching for -lsfml-graphics-s
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/SFML-2.3.1/lib/libsfml-graphics-s.a when searching for -lsfml-graphics-s
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsfml-graphics-s

它为每个库重复相同的最后四行(跳过不兼容 - 找不到)。毕竟它是这样说的:

collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[1]: *** [Debug/CodeLiteProject] Error 1
CodeLiteProject.mk:78: recipe for target 'Debug/CodeLiteProject' failed
mingw32-make.exe[1]: Leaving directory 'C:/Users/Benjamin/Documents/sfml/CodeLiteProject'
mingw32-make.exe: *** [All] Error 2

我之前真正使用编译器所做的一切都是命中 "Build and Run",所以我非常感谢任何帮助。此外,我尝试了各种不同的进入库的方式(-l*、*-s、*-s-d、*.lib、*.a 等)

您似乎没有链接调试 SFML 库,但项目是在调试模式下构建的。在 Debug 中构建时,将“-d”附加到 SFML 库名称的末尾,例如:

/TDM-GCC-64/bin/g++.exe -o ./Debug/CodeLiteProject @"CodeLiteProject.txt" -L. -LC:/SFML-2.3.1/lib  -lsfml-graphics-s-d -lsfml-window-s-d -lsfml-system-s-d -lsfml-audio-s-d -lsfml-network-s-d ... 

这一行:

C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/SFML-2.3.1/lib/libsfml-graphics-s.a when searching for -lsfml-graphics-s

此错误通常意味着您存在架构差异,即您的代码编译为 64 位应用程序,而 SFML 库构建为 32 位库。

尝试使用使用 64 位编译器构建的 SFML 库(最好使用与您正在使用的编译器相同的编译器 - TDM-GCC 64 bit/v5.1)