LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Cannot find libraries that I have installed (https://www.linuxquestions.org/questions/programming-9/cannot-find-libraries-that-i-have-installed-4175532217/)

xeon123 01-27-2015 09:59 AM

Cannot find libraries that I have installed
 
I am trying to compile Jikes 3.0.0, and despite I installed these libraries, I still get the error below. How I solve this?

Code:

sudo apt-get install gcc-multilib g++-multilib libunique-dev gconf-2.0 libgconf2-dev pango* gconf2*
The error that I have

Code:

    [exec] /usr/bin/ld: cannot find -lgconf-2
    [exec] /usr/bin/ld: cannot find -lgdk-x11-2.0
    [exec] /usr/bin/ld: cannot find -lpangocairo-1.0
    [exec] /usr/bin/ld: cannot find -lgdk_pixbuf-2.0
    [exec] /usr/bin/ld: cannot find -lpango-1.0
    [exec] /usr/bin/ld: cannot find -lcairo
    [exec] /usr/bin/ld: cannot find -lgobject-2.0
    [exec] /usr/bin/ld: cannot find -lglib-2.0
    [exec] collect2: ld returned 1 exit status


NevemTeve 01-27-2015 10:51 AM

I don't think *asterisk* would work in apt-get install

For a start, install libglib2.0-dev:
Code:

apt-get install libglib2.0-dev

sundialsvcs 01-28-2015 06:15 PM

Be sure that you have run this command: ldconfig

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.

NevemTeve 01-28-2015 11:12 PM

Or, if you want to see the actual state, use option -v eg:
Code:

ldconfig -v | grep gdk_pixbuf
ldconfig -v | less -S


evo2 01-28-2015 11:36 PM

Hi,

I can think of a couple of possible cuases. Eg

- 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.

Evo2.


All times are GMT -5. The time now is 04:59 PM.