Program can't find lib declared on ld.so.conf.d
1
vote
0
answers
256
views
I'm migrating a company-made program, who depends on a couple of also company-made libs (among other libs, of course) to a new server. In the current (old) server (RHEL 5), the lib is in /usr/lib64, but in the new server (RHEL 7), we want to put it in a non-system directory. So I put this lib in /usr/local/lib64 (together with other needed libs), inserted the path /usr/local/lib64 in file /etc/ld.so.conf.d/custom-libs.conf and ran "ldconfig -v" to update the OS' cache. All libs are correctly found, except by one of the custom made. The ldd command also fails to find the lib:
# ldd custom_program | grep custom_lib
custom_lib.so => not found
But if I run the command with var LD_LIBRARY_PATH as /usr/local/lib64, it works:
# LD_LIBRARY_PATH=/usr/local/lib64 ldd custom_program | grep custom_lib
custom_lib.so => /usr/local/lib64/custom_lib.so (0x0000...)
It also works if I put the lib (or a symlink) on /usr/lib64, but I really want to keep this as a last resort.
Asked by JucaPirama
(363 rep)
Jun 5, 2020, 02:13 AM