0

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.

3
  • Is there a reason you can't use the official version that comes with the distro? Commented Aug 22, 2016 at 18:44
  • I was using that one originally but it was giving me this error: ./sfml-app: symbol lookup error: /lib/libsfml-graphics.so.2.4: undefined symbol: __cpu_model which is what is happening now that I tried jesper's solution below Commented Aug 22, 2016 at 18:55
  • Did you check your /usr/lib64 folder? Is it a 64bit install? Commented Aug 22, 2016 at 19:11

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

That seems to have worked. Thanks! But now I have a new problem. It gives me an error saying: ./sfml-app: symbol lookup error: /lib/libsfml-graphics.so.2.4: undefined symbol: __cpu_model
@JesperJuhl Thank you, this patch worked for me on Fedora 25 with gcc 6.3.1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.