1

I have /foo/lib64/bar.so

I could link it correctly but when I start my application, it complains:

myapps: error while loading shared libraries: bar.so: cannot open shared object file: No such file or directory 

I created /etc/ld.so.conf.d/bar.conf to have

/foo/lib64 

And I did try to delete the cache /etc/ld.so.cache and rebuild.

"ldconfig -v" shows that /foo/lib64 has no dynamic library:

/foo/lib64: /lib: /lib64: libnl.so.1 -> libnl.so.1.1.4 

So certainly ldconfig picks up bar.conf. If I append /foo/lib64 to LD_LIBRARY_PATH, it works.

How can I fix it without renaming bar.so (or symlinking) and without appending /foo/lib64 to LD_LIBRARY_PATH?

Thanks in advance!

Related unresolved post

5
  • That post is pretty much resolved. The resolution is that you can't do this. It may not be a resolution you like but that's what in store. Commented May 14, 2018 at 16:17
  • But if fixing the application is an option for you, read about patchelf utility. Commented May 14, 2018 at 16:24
  • I agree that fixing the library name is the best option but unfortunately, it is a 3rd party library I have no control :( Commented May 15, 2018 at 2:46
  • @n.m. if you look at the 2nd comment of the unaccepted answer, the unaccepted answer is incorrect and according to the 2nd comment, ldconfig should be able to pick up anything .so. Commented May 15, 2018 at 2:49
  • The second comment in the unaccepted answer is incorrect. Commented May 15, 2018 at 2:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.