2

I have a program foobar that uses shared libraries. I setup LD_LIBRARY_PATH correctly and then when I run

>ldd foobar

I can see that it knows full paths to all the libraries it needs.

However, on some systems ("bigger" ones), I don't need LD_LIBRARY_PATH for ldd to know where the libraries are, and on some ("smaller" ones) I do.

On both systems, the executable foobar is the same, the path to it is the same, and all the libraries and paths to them are the same.

So that means, the rpath built into the executable, is the same in both cases.

So there must be some other way to determine where the libraries are? What is it?

2 Answers2

0

The /lib and /usr/lib are added automatically. Other libraries are added from the /etc/ld.so.conf file.

cmevoli
  • 276
  • 1
  • 3
0

ldconfig is a utility that maintains a cache of shared libraries. When properly configured, the right library paths will be cached and available to the executives. You can use ldconfig -p to print the currently available library candidates.

See the manpage for ldconfig(8).