s-d-m / lilyplayer

plays music sheets
MIT License
11 stars 2 forks source link

librtmidi.so.4: cannot open shared object file: No such file or directory #3

Closed achillis2 closed 2 years ago

achillis2 commented 4 years ago

The compile was successful. But when I tried to run lilyplayer, I got the error below.

$ ./lilyplayer ./lilyplayer: error while loading shared libraries: librtmidi.so.4: cannot open shared object file: No such file or directory

achillis2 commented 4 years ago

btw, my os is ubuntu 18.04.3

s-d-m commented 4 years ago

can you try to find out where the librtmidi has been compiled? You can find out by running:

> find  '/path/to/where/you/git/cloned/lilyplayer' -name 'librtmidi.so.4'

If this doesn't print anything, but removing the .4 at the end shows something, then you can make a symlink librtmidi.so.4 -> librtmidi.so and relaunch the app.

If it prints something, you might need try adding the directory containing the library to you LD_LIBRARY_PATH. You can do so using:

LD_LIBRARY_PATH="$(find  '/path/to/where/you/git/cloned/lilyplayer' -name 'librtmidi.so.4' | head -n 1 | xargs dirname):${LD_LIBRARY_PATH}" ./lilyplayer

Let me know the output of find '/path/to/where/you/git/cloned/lilyplayer' -name 'librtmidi.so.4' (and also without the .4 at the end) so I can help you

achillis2 commented 4 years ago

$ find ~/projects/personal/lyplayer -name 'librtmidi.so.4' /home/myusername/projects/personal/lilyplayer/3rd-party/rtmidi/.libs/librtmidi.so.4

achillis2 commented 4 years ago

lilyplayer/3rd-party/rtmidi/.libs$ ls -l total 348 -rw-r--r-- 1 myusername myusername 129404 Jan 2 21:06 librtmidi.a lrwxrwxrwx 1 myusername myusername 15 Jan 2 21:06 librtmidi.la -> ../librtmidi.la -rw-r--r-- 1 myusername myusername 964 Jan 2 21:06 librtmidi.lai lrwxrwxrwx 1 myusername myusername 18 Jan 2 21:06 librtmidi.so -> librtmidi.so.4.0.0 lrwxrwxrwx 1 myusername myusername 18 Jan 2 21:06 librtmidi.so.4 -> librtmidi.so.4.0.0 -rwxr-xr-x 1 myusername myusername 99936 Jan 2 21:06 librtmidi.so.4.0.0 -rw-r--r-- 1 myusername myusername 18224 Jan 2 21:06 rtmidi_c.o -rw-r--r-- 1 myusername myusername 97720 Jan 2 21:06 RtMidi.o

s-d-m commented 4 years ago

Then, running

LD_LIBRARY_PATH="/home/myusername/projects/personal/lilyplayer/3rd-party/rtmidi/.libs/:${LD_LIBRARY_PATH}" ./lilyplayer

should work.

In any case, it also means I can do something here to make this last step unnecessary. I'll keep this ticket open for that

achillis2 commented 4 years ago

Awesome. Your command fixed the issue. Thanks!

s-d-m commented 2 years ago

Closing this issue, now that the app does not rely on librtmidi anymore.