LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   gcc cannot find -lc library (https://www.linuxquestions.org/questions/linux-software-2/gcc-cannot-find-lc-library-80153/)

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
-bash-2.05b$

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/libc.so.6
0 lrwxrwxrwx 1 root root 13 May 30 01:22 /lib/libc.so.6 -> libc-2.3.2.so*

So libc is a sysmbolic link to libc-2.3.2.so

Do you have a symbolic link in /lib?

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

# rpm -qf /lib/libc.so.6
glibc-2.3.2-27.9

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
glibc-devel-2.3.2-27.9

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.