The linker doesn't find dynamic (shared object) libraries in /usr/lib
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu |
Invalid
|
Undecided
|
Unassigned |
Bug Description
This is the (usual) test program:
/*File: p.c*/
#include <stdio.h>
int main() {
printf( "Hello world!\n" );
return 0;
}
/*EOF*/
If I compile it like this:
gcc -o p p.c -lpq # I add an extra useless library to be linked
Averything works fine. I currently have this:
~ ls -l /usr/lib/libpq*
-rw-r--r-- 1 root root 242018 mar 6 12:50 /usr/lib/libpq.a
lrwxrwxrwx 1 root root 12 mar 6 12:49 /usr/lib/libpq.so -> libpq.so.5.4
lrwxrwxrwx 1 root root 12 mar 6 12:49 /usr/lib/libpq.so.5 -> libpq.so.5.4
-rw-r--r-- 1 root root 163308 mar 6 12:50 /usr/lib/
So both shared object and static libraries are present.
If I try instead this compilation:
~ gcc -o p p.c -lsox
/usr/bin/ld: cannot find -lsox
collect2: ld returned 1 exit status
where there is no static libary for libsox:
~ ls -l /usr/lib/libsox*
lrwxrwxrwx 1 root root 15 dic 27 22:39 /usr/lib/
-rw-r--r-- 1 root root 562436 dic 27 22:39 /usr/lib/
It used to work fine as of 11.10.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: g++ 4:4.6.3-1ubuntu5
ProcVersionSign
Uname: Linux 3.2.0-24-
ApportVersion: 2.0.1-0ubuntu7
Architecture: i386
Date: Fri May 11 09:55:12 2012
InstallationMedia: Kubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
SourcePackage: gcc-defaults
UpgradeStatus: Upgraded to precise on 2012-04-27 (14 days ago)
you are missing the -dev package fox sox