LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   gcc problem when compiling many games (https://www.linuxquestions.org/questions/linux-newbie-8/gcc-problem-when-compiling-many-games-768304/)

lilmike 11-10-2009 08:53 PM

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.

kbp 11-11-2009 12:14 AM

I believe you're missing binutils

cheers

lilmike 11-11-2009 05:53 AM

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.

kbp 11-11-2009 06:45 AM

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

Guttorm 11-11-2009 08:00 AM

Hi

On Ubuntu systems, the package to install is "build-essential".

johnsfine 11-11-2009 08:17 AM

Quote:

Originally Posted by lilmike (Post 3752353)
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.

lilmike 11-11-2009 01:37 PM

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.

lilmike 11-11-2009 01:43 PM

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.

johnsfine 11-11-2009 03:19 PM

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.

smeezekitty 11-11-2009 03:27 PM

maybe the configure script is loading from an old cache?

knudfl 11-11-2009 04:42 PM

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 '.
.....

lilmike 11-11-2009 04:47 PM

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.

johnsfine 11-11-2009 05:10 PM

Quote:

Originally Posted by lilmike (Post 3753480)
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.

lilmike 11-11-2009 07:32 PM

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.

lilmike 11-13-2009 03:47 PM

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.


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