Fedora Linux Support Community & Resources Center
  #1  
Old 30th October 2011, 12:43 AM
tkkg1001 Offline
Registered User
 
Join Date: Oct 2011
Posts: 7
linuxfirefox
Error: /usr/bin/ld: cannot find -lc when compile simplest program "hello.c"

Hello all,

I'm beginner of Linux.

I use Fedora 16 (RedHat) 64bits. I wrote a program named hello.c. I compiled it but I got following result:
"
# gcc hello.c
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
"

Please help me to resolve this issue.

Thank you very much !
Reply With Quote
  #2  
Old 30th October 2011, 01:42 AM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,105
linuxfedorafirefox
Re: Error: /usr/bin/ld: cannot find -lc when compile simplest program "hello.c"

How did you install the compiler?

BTW, this appears to be your second thread on the same topic, though it is phrased differently.
Reply With Quote
  #3  
Old 30th October 2011, 02:01 AM
linwhwylb Offline
Registered User
 
Join Date: Aug 2010
Posts: 24
linuxfirefox
Re: Error: /usr/bin/ld: cannot find -lc when compile simplest program "hello.c"

Have you installed glibc or glibc-common?
Reply With Quote
  #4  
Old 30th October 2011, 02:18 AM
tkkg1001 Offline
Registered User
 
Join Date: Oct 2011
Posts: 7
linuxfirefox
Re: Error: /usr/bin/ld: cannot find -lc when compile simplest program "hello.c"

Thank all,

I’ve just done "yum provides /usr/include/gnu/stubs.h” but I got following result:
yum provides /usr/include/gnu/stubs.h
Loaded plugins: langpacks, presto, refresh-packagekit
http:.... Timeout on
Trying other mirror.
.......

It didn’t stop but continues say “Trying other mirror.”

The staffs of my university installed it before gave me my laptop so I didn’t know how did they install.

Could you give me detail guide to solve this problem?
(What things I have to install and how to install them?, etc)

Thanks !
Reply With Quote
  #5  
Old 30th October 2011, 12:33 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,105
linuxfedorafirefox
Re: Error: /usr/bin/ld: cannot find -lc when compile simplest program "hello.c"

You need the development libraries - use

yum groupinstall "Development Libraries"

as indicated in your other thread.
Reply With Quote
  #6  
Old 2nd November 2011, 10:18 AM
tkkg1001 Offline
Registered User
 
Join Date: Oct 2011
Posts: 7
linuxfirefox
Thumbs up Re: Error: /usr/bin/ld: cannot find -lc when compile simplest program "hello.c"

Thank you all of you for your help !

I installed glibc-devel.x86_64 package successfully when I did it in my office at my university but not in my room.

Now gcc and g++ work well with hello program I said

Sincerely
Reply With Quote
Reply

Tags
compile, error, helloc, or usr or bin or ld, program, simplest

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
WoW in Wine - "Failed to find a suitable display device. Exiting program." mindexploit Gamers' Lounge 8 4th November 2011 04:42 PM
Eterm compile error running "make" command mkatl976 Using Fedora 5 2nd November 2005 11:10 PM
Compile from source issue FC3 - "Can't find X includes" theMidas Using Fedora 9 10th June 2005 01:04 PM
Error:visibility arg must be one of "default", "hidden", "protected" or "internal" wangfeng Using Fedora 0 23rd May 2005 04:59 AM
What do "Error 1" and "Error 2" mean when a compile fails? Dunhausen Using Fedora 2 23rd November 2004 06:32 PM


Current GMT-time: 09:11 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat