-   Linux - Software (
-   -   gcc cannot find -lc library (

DarkDrive 08-08-2003 11:32 AM

gcc cannot find -lc library
I'm atempting to compile bash, and gcc gives the following error (when trying to link, I'm guessing). I gather that it cannot find a library, but I have no idea what "-lc" is, or where I can find it. Any ideas? Thanks much!

-bash-2.05b$ gcc -s -static -rdynamic -g -O2 -o mkbuiltins mkbuiltins.o
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status

Corin 08-08-2003 06:05 PM

-lc means link to library c

Default library paths are /lib and /usr/lib

On Redhat 9

ll /lib/
0 lrwxrwxrwx 1 root root 13 May 30 01:22 /lib/ ->*

So libc is a sysmbolic link to

Do you have a symbolic link in /lib?

And on RedHat 9, the package to which this belongs is given by

# rpm -qf /lib/

If you do not have the glibc library installed, your system will not run
since everything(?) is linked against that.

But one of your compiler flags is -static , so you are trying to link against the static version of the c library libc.a, which lives in /usr/lib

rpm -qf /usr/lib/libc.a

So you need to install the glibc-devel package for Mandrake 9.1.

All times are GMT -5. The time now is 03:44 AM.