LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-11-2010, 01:12 PM   #1
TecH T4nK X10
LQ Newbie
 
Registered: May 2009
Posts: 14

Rep: Reputation: 0
gcc collect2: cannot find `ld'


Code:
collect2: cannot find `ld'

I'm getting this error when I try to compile any program with gcc. It doesn't matter what it is, how can I fix this?
 
Old 03-11-2010, 01:20 PM   #2
Galib
Member
 
Registered: Mar 2009
Location: $HOME
Distribution: Slackware64
Posts: 69

Rep: Reputation: 17
What is the output for
Code:
whereis ld
and
Code:
ld
?
 
Old 03-11-2010, 01:37 PM   #3
TecH T4nK X10
LQ Newbie
 
Registered: May 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Here's my output


Quote:
whereis ld
ld: /usr/bin/ld /usr/share/man/man1/ld.1.gz
ld
/bin/sh: line 2: /usr/bin/ld: Permission denied
 
Old 03-11-2010, 02:32 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
That's quite odd ...
What's the output of
Code:
ls -l /usr/bin/ld
file /usr/bin/ld
 
Old 03-11-2010, 02:55 PM   #5
TecH T4nK X10
LQ Newbie
 
Registered: May 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Here ya go. Thanks for the help so far.

Quote:
ls -l /usr/bin/ld
-rwxr-x--- 1 root compiler 323432 Jul 25 2008 /usr/bin/ld
file /usr/bin/ld
/usr/bin/ld: writable, executable, regular file, no read permission
 
Old 03-11-2010, 04:08 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Peculiar ... which distro are you using, how did you install
gcc & its mates?


Cheers,
Tink
 
Old 03-11-2010, 04:17 PM   #7
TecH T4nK X10
LQ Newbie
 
Registered: May 2009
Posts: 14

Original Poster
Rep: Reputation: 0
I'm using CentOS 4.8. Gcc was already installed.
 
Old 03-11-2010, 04:28 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hmmm ... don't have that version floating around, but find the
perms very odd indeed. In RHEL 5.2 it looks like
Code:
-rwxr-xr-x 1 root root 517608 Oct 30 2008  /usr/bin/ld
Can you run an rpm verify against your gcc install?
In that case it's actually binutils you want to check.


Cheers,
Tink

Last edited by Tinkster; 03-11-2010 at 04:30 PM.
 
Old 03-11-2010, 04:40 PM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
In addition to the above: on RHEL (which Centos is modeled after)
there doesn't even exist a 'compiler' group which your ld is owned
by ... this is rather bizarre.



Cheers,
Tink
 
  


Reply



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
cannot find -lpcap collect2: ld returned 1 exit status nasim751 Programming 1 02-12-2008 01:57 PM
ld: cannot find -lc collect2: ld returned 1 exit status ArbuZz Linux From Scratch 3 09-27-2005 12:52 AM
collect2: cannot find `ld' - problem on installing alsa-oss satimis Linux From Scratch 6 09-15-2005 12:07 AM
cannot find `ld' artois_val Linux - Newbie 2 01-28-2004 07:43 PM
collect 2: cannot find 'ld' dancindoc Linux - Newbie 1 09-08-2002 01:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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