yglukhov / nimx

GUI library
MIT License
1.1k stars 75 forks source link

could not load: libSDL2.so [under Ubuntu 16.04.2] #231

Closed vladyio closed 7 years ago

vladyio commented 7 years ago

Running on Ubuntu 16.04.2 (to be accurate, it's an Ubuntu fork called elementaryOS), nim 0.17.0 (2017-05-17).

Trying to compile an example from the README: nim c -r --noMain --threads:on main.nim

What I get after the compilation:

could not load: libSDL2.so
compile with -d:nimDebugDlOpen for more information
Error: execution of an external program failed: '/home/vladyio/projects/nim/Tutz/tutzui/main '

Running with -d:nimDebugDlOpen prints out just libSDL2.so: cannot open shared object file: No such file or directory

As far as I understand I have libSDL installed on my system since ls /usr/lib/x86_64-linux-gnu/ | grep libSD gives the following:

libSDL-1.2.so.0
libSDL-1.2.so.0.11.4
libSDL2-2.0.so.0
libSDL2-2.0.so.0.4.0
libSDL.a
libSDL_image-1.2.so.0
libSDL_image-1.2.so.0.8.4
libSDLmain.a
libSDL_mixer-1.2.so.0
libSDL_mixer-1.2.so.0.12.0
libSDL.so

Maybe I have to set up some symlinks for the library or anything else? Where must I put the libSDL file?

vladyio commented 7 years ago

Okay, I just needed to create these symlinks (maybe one of them is odd):

ln -s /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 /usr/lib/libSDL2.so
ln -s /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 /usr/local/lib/libSDL2.so

Now it works.