简体   繁体   中英

Building SFML on Fedora 24 linking error: error while loading shared libraries: libsfml-graphics.so.2.4: cannot open shared object file

I have been trying to get SFML working on Fedora 24 for a few days now and I can't seem to get it to work. The program compiles and links fine, but when I try to run the compiled program I get this error:

./sfml-app: error while loading shared libraries: libsfml-graphics.so.2.4: cannot open shared object file: No such file or directory

I know that the files are there since they are all located in the /usr/lib directory:

ls /usr/lib | grep sfml
libsfml-audio-d.so
libsfml-audio-d.so.2.4
libsfml-audio-d.so.2.4.0
libsfml-graphics-d.so
libsfml-graphics-d.so.2.4
libsfml-graphics-d.so.2.4.0
libsfml-network-d.so
libsfml-network-d.so.2.4
libsfml-network-d.so.2.4.0
libsfml-system-d.so
libsfml-system-d.so.2.4
libsfml-system-d.so.2.4.0
libsfml-window-d.so
libsfml-window-d.so.2.4
libsfml-window-d.so.2.4.0

I think the problem is that it is looking for libsfml-graphics.so.2.4 but the file is actually named libsfml-graphics -d .so.2.4. The -d is in the actual file name for some reason. I tried making a link to the file without the -d but it still did not work.

I built SFML myself with CMake and make then installed it using make install .

When I run ldconfig -p | grep sfml I get this:

libsfml-window-d.so.2.4 (libc6,x86-64) => /lib/libsfml-window-d.so.2.4
libsfml-window-d.so (libc6,x86-64) => /lib/libsfml-window-d.so
libsfml-system-d.so.2.4 (libc6,x86-64) => /lib/libsfml-system-d.so.2.4
libsfml-system-d.so (libc6,x86-64) => /lib/libsfml-system-d.so
libsfml-network-d.so.2.4 (libc6,x86-64) => /lib/libsfml-network-d.so.2.4
libsfml-network-d.so (libc6,x86-64) => /lib/libsfml-network-d.so
libsfml-graphics-d.so.2.4 (libc6,x86-64) => /lib/libsfml-graphics-d.so.2.4
libsfml-graphics-d.so (libc6,x86-64) => /lib/libsfml-graphics-d.so
libsfml-audio-d.so.2.4 (libc6,x86-64) => /lib/libsfml-audio-d.so.2.4
libsfml-audio-d.so (libc6,x86-64) => /lib/libsfml-audio-d.so

Any help with getting this working will be much appreciated. :)

Edit:
I got it working downloading the official fedora SFML package. I guess the first time I installed it I forgot to also install the SFML-devel package.

The '-d' files are the debug versions of the library (if I remember SFML's naming convention correctly). You seem to be missing the non-debug version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM