SFML 2.3 和 CodeBlocks 错误编译

SFML 2.3 and CodeBlocks error compilation

我正在尝试使 sfml 与代码块一起工作。我做了这个视频教程中所说的一切:https://www.youtube.com/watch?v=gEGWO8ug2bY

如果我只添加 SFML/Graphics.hpp 一切正常,所以我的配置还算不错。
但是,如果我尝试添加 SFML/Audio.hpp(我需要向我的项目添加声音)并写入 "sf::Music background_music;",我会收到错误消息:

    ||=== Build: Debug in JeudeGo (compiler: GNU GCC Compiler) ===|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundStream.cpp|52|undefined reference to `sf::Thread::~Thread()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundStream.cpp|70|undefined reference to `sf::Thread::wait()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundStream.cpp|59|undefined reference to `sf::Thread::~Thread()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundStream.cpp|59|undefined reference to `sf::Thread::~Thread()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundStream.cpp|135|undefined reference to `sf::Thread::launch()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundStream.cpp|166|undefined reference to `sf::Thread::wait()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundStream.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundStream.cpp|228|undefined reference to `sf::Thread::launch()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(InputSoundFile.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\InputSoundFile.cpp|74|undefined reference to `sf::FileInputStream::FileInputStream()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(InputSoundFile.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\InputSoundFile.cpp|79|undefined reference to `sf::FileInputStream::open(std::string const&)'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(InputSoundFile.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\InputSoundFile.cpp|117|undefined reference to `sf::MemoryInputStream::MemoryInputStream()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(InputSoundFile.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\InputSoundFile.cpp|122|undefined reference to `sf::MemoryInputStream::open(void const*, unsigned int)'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundFileFactory.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundFileFactory.cpp|71|undefined reference to `sf::FileInputStream::FileInputStream()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundFileFactory.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundFileFactory.cpp|72|undefined reference to `sf::FileInputStream::open(std::string const&)'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundFileFactory.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundFileFactory.cpp|78|undefined reference to `sf::FileInputStream::seek(long long)'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundFileFactory.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundFileFactory.cpp|84|undefined reference to `sf::FileInputStream::~FileInputStream()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundFileFactory.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundFileFactory.cpp|84|undefined reference to `sf::FileInputStream::~FileInputStream()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundFileFactory.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundFileFactory.cpp|95|undefined reference to `sf::MemoryInputStream::MemoryInputStream()'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundFileFactory.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundFileFactory.cpp|96|undefined reference to `sf::MemoryInputStream::open(void const*, unsigned int)'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundFileFactory.cpp.obj):D:\sfml-release\_Sources\SFML\src\SFML\Audio\SoundFileFactory.cpp|101|undefined reference to `sf::MemoryInputStream::seek(long long)'|
D:\Info\SFML-2.3\lib\libsfml-audio-s-d.a(SoundFileFactory.cpp.obj):D:\sfml-release\_Sources\SFML\include\SFML\System\MemoryInputStream.hpp|43|undefined reference to `vtable for sf::MemoryInputStream'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_write'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| more undefined references to `oggpack_write' follow|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_readinit'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_readinit'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| more undefined references to `oggpack_read' follow|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_read'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| more undefined references to `oggpack_read' follow|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_writeinit'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_bytes'|
D:\Info\SFML-2.3\lib\libvorbis.a(info.o):info.c|| undefined reference to `oggpack_writeclear'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

我的链接库(按此顺序):

sfml-graphics-s-d 
sfml-window-s-d 
sfml-system-s-d 
sfml-audio-s-d 
sfml-network-s-d 
flac 
ogg 
vorbis 
vorbisenc 
vorbisfile 
openal32
jpeg
freetype
ws2_32
gdi32
opengl32
winmm 

和#defines :

SFML_STATIC
UNICODE

感谢帮助!

尝试重新排序您的链接。 Sfml 系统应该在您的链接器设置中放在最后或前面。它应该是最后一个 SFML 链接。