1

I have an executable vimba, which uses a shared library libVmbC.so, which is not installed to the standard location. The copies reside at:

paul@desktop:~/st-cpp/vimba/build$ sudo find / -name "libVmbC.so"
/home/paul/VimbaX_2023-4/api/lib/libVmbC.so
/home/paul/VimbaX_2023-4/bin/libVmbC.so

On a new Ubuntu 23.10 installation, I added it to the LD_LIBRARY_PATH and everything works fine. On the "old" Ubuntu 22.04 system, this library is not on LD_LIBRARY_PATH path, which is empty:

paul@desktop:~/st-cpp/vimba/build$ echo $LD_LIBRARY_PATH

nor it's detected by ldconfig:

paul@desktop:~/st-cpp/vimba/build$ ldconfig -p | grep libVmbC.so

nor it is listed in ld.so.conf or any of the files included by it. ldd is able to locate it and vimba runs fine, though:

paul@desktop:~/st-cpp/vimba/build$ ldd vimba
    linux-vdso.so.1 (0x00007ffd179a3000)
    libtbb.so.12 => /usr/local/lib/libtbb.so.12 (0x00007f23bb448000)
    libVmbC.so => /home/paul/VimbaX_2023-4/api/lib/libVmbC.so (0x00007f23bb000000)
...

How does ldd know to find it at /home/paul/VimbaX_2023-4/api/lib/libVmbC.so?

  • 1
    Is RPATH or RUNPATH set in the binary? – muru Mar 18 '24 at 01:40
  • @muru Yes, it was: Library runpath: [/home/paul/VimbaX_2023-4/api/lib:/usr/local/lib]. Thank you for the link. I didn't know about RPATH. The new system has a different username, which prevented RPATH from working. If post your comment as an answer, I will accept it as a solution. – Paul Jurczak Mar 18 '24 at 04:39
  • It's covered well in the answer there and in the duplicate target of that question – muru Mar 18 '24 at 06:04

0 Answers0