I’ve just compiled a test application using some libraries provided by a custom third party vendor. There is no installation/package manager. The application builds as expected. However, when I go to run it, it can’t seem to find a necessary .so file (which I’ve got sitting in the same directory):
[diego@localhost Debug]$ ls
esdcan libntcan.so.3 makefile objects.mk sources.mk src
[diego@localhost Debug]$ ./esdcan
./esdcan: error while loading shared libraries: libntcan.so.3: cannot open shared object file: No such file or directory
[diego@localhost Debug]$ ldd esdcan
linux-vdso.so.1 => (0x00007fff125ff000)
libntcan.so.3 => not found
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00000031d2600000)
libm.so.6 => /lib64/libm.so.6 (0x00000031c7600000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00000031c8600000)
libc.so.6 => /lib64/libc.so.6 (0x00000031c7200000)
/lib64/ld-linux-x86-64.so.2 (0x00000031c6e00000)
I’m missing some step I’m sure, I’m just completely unaware of what that step is.
Run
ldconfigafter completing the build, as well as making sure that the current directory is inside your/etc/ld.so.conffile so that the current directory is a trusted directory to look for shared libraries.