LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-08-2003, 10:32 AM   #1
DarkDrive
LQ Newbie
 
Registered: Jul 2003
Location: Albuquerque, NM
Distribution: MDK 9.1
Posts: 24

Rep: Reputation: 15
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$
 
Old 08-08-2003, 05:05 PM   #2
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
-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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to link a library to gcc? Andrea_81 Programming 6 05-05-2005 04:22 AM
Changing gcc library path jon_k Linux - Software 1 08-22-2004 12:09 AM
GCC doesn't find the Standard-Library the_styler Linux - Software 11 01-15-2004 08:09 PM
gcc 3.3.2, shared library luzi82 Debian 2 12-21-2003 09:35 AM
Want to get GCC library help TamArasan Linux - Software 1 08-14-2003 08:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration