Re: ld finds some libraries, but not others.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/15/2011 09:06 AM, Jonathan Ryshpan wrote:
A build is failing with the error cannot find<library>  for libraries
that are, in fact present on the system.

I made a very simple test bed, consisting of the empty file conftest.c,
which I attempt to compile and link with various libraries.  All the
libraries are in /usr/lib64.  Sometimes the compilation fails with
         undefined reference to `main'
which is what I would expect, but often it fails with
         cannot find -l<whatever>
I have no idea what's happening.  Can anyone explain?

You likely don't have the *-devel packages installed, which correspond to the libraries you want to link against.

Here's an example of what's going on.  This is a listing of some files
in /usr/lib64:
...
         lrwxrwxrwx. 1 root root     14 Nov  9 08:14 libgd.so.2 ->  libgd.so.2.0.0*
         -rwxr-xr-x. 1 root root 278048 Oct 26 20:15 libgd.so.2.0.0*
... These are the run-time libraries ...

And here's a attempt to compile the dummy linking to them:
...
         1034 wview-5.19.0 $ gcc -o conftest -g -O2 conftest.c -lgd
         /usr/bin/ld: cannot find -lgd
         collect2: ld returned 1 exit status
Here, ld is looking for "libgd.so".

=> You want to install the package which provides /usr/lib64/libgd.so

# repoquery -qf /usr/lib64/libgd.so
gd-devel-0:2.0.35-13.fc16.x86_64

Ralf
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux