The linker doesn't find dynamic (shared object) libraries in /usr/lib

Bug #997938 reported by Uqbar
6
This bug affects 1 person
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/libpq.so.5.4

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/libsox.so.1 -> libsox.so.1.0.0
-rw-r--r-- 1 root root 562436 dic 27 22:39 /usr/lib/libsox.so.1.0.0

It used to work fine as of 11.10.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: g++ 4:4.6.3-1ubuntu5
ProcVersionSignature: Ubuntu 3.2.0-24.38-generic-pae 3.2.16
Uname: Linux 3.2.0-24-generic-pae i686
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)

Revision history for this message
Uqbar (uqbar) wrote :
Revision history for this message
Matthias Klose (doko) wrote :

you are missing the -dev package fox sox

Changed in gcc-defaults (Ubuntu):
status: New → Invalid
affects: gcc-defaults (Ubuntu) → ubuntu
Revision history for this message
Uqbar (uqbar) wrote :

If you had read the original report, you could have seen two major things.

1. The shared library file(s) for libsox were in place and readable

2. After two years and a few releases maybe something has been fixed.

It is an invalid bug indeed, as it doesn't make sense any more.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.