I’m trying to explain a complex problem, so bear with me.
Say I have these files
/path/build/
/path/build/liba.so
/path/build/liba.so.3 -> liba.so
/path/build/libtest.so
I even have set PATH=/path/build:... (where ... is my normal $PATH).
At some point libtest.so will load liba.so.3 at runtime.
However, liba.so.3 doesn’t seem to exist when running code that (successfully) loads libtest.so, and when I ask ldd for help, I get this:
$ ldd /path/build/libtest.so
linux-vdso.so.1 => (0x00007fff24fff000)
liba.so.3 => not found
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f8fea222000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8fe9f9e000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8fe9d88000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f8fe9b6a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8fe97c9000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8fea767000)
(note the second output line)
How can I figure out what’s going wrong? The library is clearly there, but the loader claims it’s not.
Is /path/build on your LD_LIBRARY_PATH? The linux dynamic loader looks here for libraries on Linux, after the default locations