当我在链接一个项目时,链接器会报以下错误:
/usr/bin/ld: ../Includes and Libs/lib/libsfml21rca.a(SoundFile.o): undefined reference to symbol 'sf_read_short@@libsndfile.so.1.0'
/usr/bin/ld: note: 'sf_read_short@@libsndfile.so.1.0' is defined in DSO /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libsndfile.so so try adding it to the linker command line
/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libsndfile.so: could not read symbols: Invalid operation
问题在于,libsndfile.so已经在libsfml21rca.a之前被链接了,所以我不知道问题出在哪里。
我正在使用Code :: Blocks 10.05
提前感谢您的帮助
编辑:
这是链接命令:
g++ -L“Includes and Libs / lib” -L“Includes and Libs / lib / raknet3_731” -L“Includes and Libs / lib / d3d_new / x86” -L“Includes and Libs / lib / ogg” -L“Includes and Libs / lib / sdl ”-LBullet / lib-o(文件名)...(大量的对象文件)-lGLEW-lglfw-lGL-lGLU-lpthread-lOpenAL-ljpeg-lfreetype-lsndfile-lXrandr-lsfml-system-lsfml-window-lsfml-audio ../Bullet/lib/LinearMath.lib ../Bullet/lib/BulletCollision.lib ../Bullet/lib/BulletDynamics.lib“../Includes and Libs / lib / raknet3_731 / RakNetLibStaticDebug.lib”“../Includes and Libs / lib / libsfml21rca.a”../../../../../../home/msabol/Desktop/SFML/sfml2st/sfmlVideo/sfmlVideo/bin/Release/libsfmlVideo.a ../../../../../../home/msabol/Desktop/SFML/sfmlVideo/bin/Release/libsfmlVideo.a