我用的Kubuntu 14.04,Eclipse CDT的,喜歡包括CSFML其產生這個錯誤:的Eclipse CDT/CSFML,錯誤而載入共享庫
/home/u123/Prog/Test/Debug/Test: error while loading shared libraries: libcsfml-audio.so.2.2: cannot open shared object file: No such file or directory
我的編譯器設置:
-DCSFML_STATIC -I/home/u123/Prog/CSFML-2.2/include -O0 -g3 -Wall -c -fmessage-length=0
我的鏈接設置
-L/home/u123/Prog/CSFML-2.2/lib -L/usr/local/lib -Xlinker -rpath /home/u123/Prog/SFML-2.2/lib
-v LDCONFIG
的一些輸出0/home/u123/Prog/CSFML-2.2/lib:
libcsfml-system.so.2.2 -> libcsfml-system.so.2.2.0
libcsfml-graphics.so.2.2 -> libcsfml-graphics.so.2.2.0
libcsfml-window.so.2.2 -> libcsfml-window.so.2.2.0
libcsfml-audio.so.2.2 -> libcsfml-audio.so.2.2.0
directorys:
[email protected]:~$ ls /home/u123/Prog/CSFML-2.2/lib
libcsfml-audio.so libcsfml-graphics.so libcsfml-network.so libcsfml-system.so libcsfml-window.so
libcsfml-audio.so.2.2 libcsfml-graphics.so.2.2 libcsfml-network.so.2.2 libcsfml-system.so.2.2 libcsfml-window.so.2.2
libcsfml-audio.so.2.2.0 libcsfml-graphics.so.2.2.0 libcsfml-network.so.2.2.0 libcsfml-system.so.2.2.0 libcsfml-window.so.2.2.0
[email protected]:~$ ls /home/u123/Prog/SFML-2.2/lib
libsfml-audio.so libsfml-graphics.so.2.2.0 libsfml-system.so libsfml-window.so.2.2.0
libsfml-audio.so.2.2.0 libsfml-network.so libsfml-system.so.2.2.0 pkgconfig
libsfml-graphics.so libsfml-network.so.2.2.0 libsfml-window.so
LDD:
[email protected]:~$ ldd /home/u123/Prog/Test/Debug/Test
linux-vdso.so.1 => (0x00007ffec7bfe000)
libcsfml-graphics.so.2.2 => /home/u123/Prog/CSFML-2.2/lib/libcsfml-graphics.so.2.2 (0x00007f226358b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f22631c6000)
libsfml-graphics.so.2.2.0 => not found
libsfml-window.so.2.2.0 => not found
libsfml-system.so.2.2.0 => not found
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2262ec0000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2262caa000)
/lib64/ld-linux-x86-64.so.2 (0x000055fd8c8fb000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f22629a3000)
在我看來(但我不是很在經歷SFML)CSFML是C代碼,就像一個門面,是指到SFML C++代碼。
問題出在哪裏?謝謝。
是不是'C'在rpath中失蹤? – Hiura
不,imho CSFML需要鏈接到SFML –