ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
You must be root to do this. It might have been run already (by the install-script that apt-get invoked), but there's no harm in running it again.
When ld (the Linux program-loader ...) loads a program into memory, that program will usually specify a list of external libraries that it needs. Well, it would take much too long if ld actually had to search for all those libraries, one by one. So, instead, there is a cache.
This cache tells ld exactly where to find each library that any program might need. Therefore, ld doesn't have to "look" ... and, more to the point, it doesn't look. Instead, it refers to the cache to find "the answer." But then, it will complain (as you have already seen ...) if "the answer" turns out to be wrong ... if the library-file actually isn't "right there."
The ldconfig command rebuilds that cache. It locates every library that might be referred-to, determines where each one of them is, then constructs a cache-file which describes every one of the "alternate names" that might be used by any application. (Applications can be as specific or as generic as they wish to be ... "libxml, please" or "libxml.1.2.3, please" ... and ldconfig will figure all of it out and record all of these answers into the cache.)
So, if "an app can't find a library," but "you know that it's there," the cause of the problem will turn out to be an out-of-date cache.
- Are you sure those packages fully installed cleanly? (You can check with
"dpkg -l <packagename>"). The post install scripts should take care of running ldconfig automatically
- Did you run ./configure (or equivalent) again after installing the packages?
If something you are trying to compile has a large number of dependencies you might find it useful to use auto-apt to automatically install them for you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.