Operating System - Linux
1819743 Members
2944 Online
109606 Solutions
New Discussion юеВ

Re: C compiler cannot create executables

 
SOLVED
Go to solution
Sajeesh O.K
Advisor

C compiler cannot create executables

Hi

I am trying to install the Apahce
with the configure command. I am getting the error like below.
"checking for C compiler default output file name... configure: error: C compiler cannot create executables. see config.log "

Please help. Also find the attached file.

Thanks
Sajeesh
8 REPLIES 8
Stuart Browne
Honored Contributor

Re: C compiler cannot create executables

What did 'config.log' say?
One long-haired git at your service...
Sajeesh O.K
Advisor

Re: C compiler cannot create executables

Browne

configure: exit 1
I have attached the same.

Thanks
Sajeesh
Stuart Browne
Honored Contributor

Re: C compiler cannot create executables

Umm, you wanna attach the log file please? :)
One long-haired git at your service...
Sajeesh O.K
Advisor

Re: C compiler cannot create executables

Oh. Sorry. Please find the config.log
Stuart Browne
Honored Contributor

Re: C compiler cannot create executables

Hrm, ok.. So you're using RH AS2.1 with e.30 SMP kernel.

It doesn't give any real errors unfortunately.

So lets start with some basic questions and tests.

How did you gain 'root' access? Brief guess based on prompt was (at least) a 'su -'. This is good.

What directory are you doing the configure in, and what's the output of 'ls -ld .' from that directory?

Next thing is a quick check of gcc. Start with the output of 'ls -ld $(which gcc)' in a bourne shell, and possibly the output of 'rpm -q gcc'

Next is verifying you've got include files to play with, namely 'rpm -q kernel-headers' and 'ls -l /usr/include'.

If all of these are good, then try to compile something simple:

------------- junk.c ----------------
#include

int main(int *argc, char *argv[]){
printf( "Welcome. This is your world!\n");
}
------------- junk.c ----------------

then type the following 3 commands:

gcc junk.c -o junk
ls -l junk
./junk

These commands should create the bare-bones C source for a simple 'Hello World' application, list it, then execute it.

Lets see if we get this far first ;) If you've got a development system installed, you should get through all of the listed commands without any errors..

Post back with results!
One long-haired git at your service...
Sajeesh O.K
Advisor

Re: C compiler cannot create executables

Browne

I suspect the problem with gcc installation.
To your queries, everything is okay except the last c programm execution.

When I execute, first got the error msg
gcc: installation problem, cannot exec `cpp': No such file or directory
I installed cpp.

When execute again got the error msg
gcc: installation problem, cannot exec `as': No such file or directory.

I installed the following rpms
asp2php-0.75.17-1
ash-0.3.7-2
asp2php-gtk-0.75.17-1
aspell-0.33.7-1

But still with 'which as' I am not getting
/usr/bin/as

kernel-headers-2.4.9-e.3 is in the rpm list

Regards
Sajeesh

Stuart Browne
Honored Contributor
Solution

Re: C compiler cannot create executables

Ok. It means that most of the development environment is not present.

'gcc' is only one of the many tools needed to compile things.

It relies upon things such as 'ld' and 'as' and others to do various actions regarding linking in the different libraries.

It sounds like you're missing the 'binutils' package.

Install that, give it another shot, and we'll se where we get.
One long-haired git at your service...
Sajeesh O.K
Advisor

Re: C compiler cannot create executables

Browne

binutils was missing and I installed the same. Solved the Problem !

Many Thanks
Sajeesh