LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 11-10-2009, 09:53 PM   #1
lilmike
Member
 
Registered: Nov 2009
Location: Baton Rouge, Louisiana
Distribution: Ubuntu
Posts: 57

Rep: Reputation: 15
Question gcc problem when compiling many games


Hi,
I am getting an error about gcc cannot create executables, I think it is a package I don't have installed.
I think this because it works on other things.
It says this when I try ./configure on one moo:
Quote:
loading cache ./config.cache
checking for bison... bison -y
checking for gcc... gcc
checking whether the C compiler (gcc ) works... no
configure: error: installation or configuration problem: C compiler cannot creat
e executables.
brlboy@mtgames:~/MOO-1.8.2g4r1$
Then when I look at config.log, it says this:
Quote:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:563: checking for bison
configure:596: checking for gcc
configure:709: checking whether the C compiler (gcc ) works
configure:725: gcc -o conftest conftest.c 1>&5
/usr/bin/ld: cannot find /lib/ld-linux.so.2
collect2: ld returned 1 exit status
configure: failed program was:

#line 720 "configure"
#include "confdefs.h"

main(){return(0);}
Any help with figuring out which package is responsible would be apreciated.
-Michael.

P.S. I am using ubuntu 9.10.
 
Old 11-11-2009, 01:14 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
I believe you're missing binutils

cheers
 
Old 11-11-2009, 06:53 AM   #3
lilmike
Member
 
Registered: Nov 2009
Location: Baton Rouge, Louisiana
Distribution: Ubuntu
Posts: 57

Original Poster
Rep: Reputation: 15
Wink

Oh man, it appears I already have binutils.
Quote:
Reading package lists... Done
Building dependency tree
Reading state information... Done
binutils is already the newest version.
binutils set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-Michael.
 
Old 11-11-2009, 07:45 AM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
Ooops .. my mistake, according to my system /lib/ld-linux.so.2 belongs to glibc, can you verify the validity of your glibc package ? .. I'm not sure what the command is on your system

cheers
 
Old 11-11-2009, 09:00 AM   #5
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,261

Rep: Reputation: 297Reputation: 297Reputation: 297
Hi

On Ubuntu systems, the package to install is "build-essential".
 
Old 11-11-2009, 09:17 AM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by lilmike View Post
Code:
/usr/bin/ld: cannot find /lib/ld-linux.so.2
Any help with figuring out which package is responsible would be apreciated.
"What package includes the file that some programs complains for lack of?"

That is a common question and you should learn the generic answer, even though in this case Guttorm gave you a better specific answer.

Bookmark this page:
http://packages.ubuntu.com/

Scroll down to where it says Search the contents of packages

Paste the name of the missing file into the box there (I pasted in ld-linux.so.2

Click Search. That brought me to a page that tells me the package name is libc6

In this particular situation, I think it is better to install build-essential.

If you installed libc6, I expect that would fix the problem with ld-linux.so.2 and just get you to the next missing file toward what you want to accomplish. A few rounds of that would get the job done. But installing build-essential is easier and better.
 
Old 11-11-2009, 02:37 PM   #7
lilmike
Member
 
Registered: Nov 2009
Location: Baton Rouge, Louisiana
Distribution: Ubuntu
Posts: 57

Original Poster
Rep: Reputation: 15
Question

Hi,
I installed build-essentials
I also tried installing libc6, but it said it was already the latest version.
It still gives an error, it looks like the same error.
Anyway, just in case it isn't. here it is:
Quote:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:563: checking for bison
configure:596: checking for gcc
configure:709: checking whether the C compiler (gcc ) works
configure:725: gcc -o conftest conftest.c 1>&5
/usr/bin/ld: cannot find /lib/ld-linux.so.2
collect2: ld returned 1 exit status
configure: failed program was:

#line 720 "configure"
#include "confdefs.h"

main(){return(0);}
I looked for the file on packages.ubuntu.com, and found the same you did.
This mentions something about /usr/ld, could that be a problem?

-Michael.
 
Old 11-11-2009, 02:43 PM   #8
lilmike
Member
 
Registered: Nov 2009
Location: Baton Rouge, Louisiana
Distribution: Ubuntu
Posts: 57

Original Poster
Rep: Reputation: 15
Exclamation very interesting

Hi,
I just did, out of curiosity, sudo ./configure
It, to my utter amazement, worked.
I wonder why you can run it as root, and it works, but you can't as a user?
-Michael.
 
Old 11-11-2009, 04:19 PM   #9
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
That is all confusing. It is not supposed to act that way.

Try
Code:
ls -l /lib/ld*
and
Code:
file /lib/ld*
What files and symbolic links are listed and what access rights do they have?
If the access rights are limited enough, you might need to sudu just to get that info.

On every system I've used, all that is world readable.
 
Old 11-11-2009, 04:27 PM   #10
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,330

Rep: Reputation: 227Reputation: 227Reputation: 227
maybe the configure script is loading from an old cache?
 
Old 11-11-2009, 05:42 PM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153Reputation: 3153
May be

sudo apt-get install libc6-dev

.. Or use 'synaptic' for the install


'gcc' really can't create much without this.

Also suggested : sudo apt-get install g++
.....
P.S.: # 10
Quote:
maybe the configure script is loading from an old cache
.. Please delete ' config.cache '.
.....

Last edited by knudfl; 11-11-2009 at 05:53 PM.
 
Old 11-11-2009, 05:47 PM   #12
lilmike
Member
 
Registered: Nov 2009
Location: Baton Rouge, Louisiana
Distribution: Ubuntu
Posts: 57

Original Poster
Rep: Reputation: 15
Question

Hi,
When I do ls -l /lib/ld*, it returns this:
Quote:
-rwxr-xr-x 1 root root 113320 Oct 7 08:50 /lib/ld-2.10.1.so
lrwxrwxrwx 1 root root 12 Oct 30 17:57 /lib/ld-linux.so.2 -> ld-2.10.1.so
When I do file /lib/ld*, it returns this:
Quote:
/lib/ld-2.10.1.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV),
dynamically linked, stripped
/lib/ld-linux.so.2: symbolic link to `ld-2.10.1.so'
It does mention something about /usr/ld in that config.log, do you think that has anything to do with it?
-Michael.
 
Old 11-11-2009, 06:10 PM   #13
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by lilmike View Post
It does mention something about /usr/ld in that config.log, do you think that has anything to do with it?
Sorry about ignoring that question before.

/usr/bin/ld is the name of the program that is complaining about the lack of /lib/ld-linux.so.2

But you have shown that /lib/ld-linux.so.2 is readable by non root.

/lib/ld-linux.so.2 is a symbolic link to /lib/ld-2.10.1.so and /lib/ld-2.10.1.so is the 32 bit ELF file it ought to be (assuming you are running 32 bit Ubuntu, not 64 bit Ubuntu).

I don't even have a guess why /usr/bin/ld can find /lib/ld-linux.so.2 when run as root but not when run as non root.
 
Old 11-11-2009, 08:32 PM   #14
lilmike
Member
 
Registered: Nov 2009
Location: Baton Rouge, Louisiana
Distribution: Ubuntu
Posts: 57

Original Poster
Rep: Reputation: 15
Exclamation

Hi,
I'm sorry, I thought you meant that I should run ls -l /lib/ld* and file /lib/ld* with sudo, sorry.
Still, the output appears to be the same without sudo.
Here it is, anyway.
Quote:
dragonsmoo@mtgames:~$ ls -l /lib/ld*
-rwxr-xr-x 1 root root 113320 Oct 7 08:50 /lib/ld-2.10.1.so
lrwxrwxrwx 1 root root 12 Oct 30 17:57 /lib/ld-linux.so.2 -> ld-2.10.1.so
dragonsmoo@mtgames:~$ dragonsmoo@mtgames:~$ file /lib/ld*
/lib/ld-2.10.1.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV),
dynamically linked, stripped
/lib/ld-linux.so.2: symbolic link to `ld-2.10.1.so'
dragonsmoo@mtgames:~$
I don't think anything has changed.
Also, I tried apt-get install libc6-dev, and apt-get install g++, and they both returned that they are already the latest version.
Now, I just tried to ./configure on another user, same perms, same group, everything, and, to my disbelief, it worked!
Is there any flag I might need to set on a user to get this to work?
If you aren't sure, is there a way I can compare their attributes, and see what's different?
And then, how can I change the attributes.
Thanks,
-Michael.
 
Old 11-13-2009, 04:47 PM   #15
lilmike
Member
 
Registered: Nov 2009
Location: Baton Rouge, Louisiana
Distribution: Ubuntu
Posts: 57

Original Poster
Rep: Reputation: 15
Question

Hi,
I was wondering if there is a way to check flags, and other things of a user, so I can see if there is something different between the user that can compile the server, and that one that can't.
Thanks,
-Michael.
 
  


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
Problem compiling GCC 4.0.3 dustin_wielenga Linux From Scratch 3 01-16-2008 12:02 AM
gcc compiling problem chiahsin Linux - Software 2 12-02-2004 07:33 PM
GCC compiling problem C, SuSE 9.1 Bill Chandler Linux - Software 3 11-24-2004 02:30 AM
GCC compiling problem webwolf70 Linux From Scratch 3 09-25-2004 09:51 PM
Problem compiling gcc gkiagia Programming 4 05-31-2004 04:18 AM


All times are GMT -5. The time now is 07:34 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration