C compiler cannot create executables.

Find out how to get that @*&^$&@ thing to compile!

C compiler cannot create executables.

Postby dglewis » Thu Oct 11, 2001 10:49 am

In my attempts to compile _anything_ on darwin, configure always squawks at me with this - for example:

<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre> $ ./configure
loading cache ./config.cache
configuring for GNU Wget 1.7
checking host system type... powerpc-apple-darwin1.4
checking whether make sets ${MAKE}... yes
checking for a BSD compatible install... /usr/bin/install -c
checking build system type... powerpc-apple-darwin1.4
checking for ranlib... ranlib
checking for gcc... gcc
checking whether the C compiler (gcc ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables. </pre>[/quote]

I can give more info however I presume this is an easy one for you all. If this isn't a common problem, I'll gladly list more details about my system. Thanks for any help [img]images/icons/smile.gif"%20border="0[/img]
Dan
dglewis
 
Posts: 27
Joined: Mon Sep 17, 2001 7:00 pm

Re: C compiler cannot create executables.

Postby dglewis » Thu Oct 11, 2001 8:50 pm

[img]images/icons/shocked.gif"%20border="0[/img] I suppose if I'm gonna run 10.1, I should also install the appropriate 10.1 dev tools hehe

That's what solved it - upgrading the tools. Thanks for your help apex!

I'm up and running again -

I get all kinds of good errors now [img]images/icons/grin.gif"%20border="0[/img]

<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre> ...gcc -I. -I. -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\"/usr/local/etc/wgetrc\" -DLOCALEDIR=\"/usr/local/share/locale\" -g -O2 -c html-parse.c
html-parse.c: In function `advance_declaration':
html-parse.c:449: character constant too long
html-parse.c:449: parse error before character constant
html-parse.c:449: stray '\' in program
html-parse.c:454: character constant too long
html-parse.c:461: character constant too long
html-parse.c:472: character constant too long
html-parse.c:481: character constant too long
html-parse.c:481: character constant too long
html-parse.c:481: stray '\' in program
html-parse.c:773: Unterminated string constant
make[1]: *** [html-parse.o] Error 1
make: *** [src] Error 2
</pre>[/quote]

I'll attempt to figure these out for awhile ... I'm just happy I'm getting some decent errors heh

[ October 11, 2001: Message edited by: Dan ]
Dan
dglewis
 
Posts: 27
Joined: Mon Sep 17, 2001 7:00 pm

Re: C compiler cannot create executables.

Postby apex » Fri Oct 12, 2001 7:40 am

From previous post by Jasont:
[code]
Make sure you have the directories:
/usr/local/bin
Check with ls /usr/local and ls /usr/local/bin
If not you want to create them with:
mkdir /usr/local
mkdir /usr/local/bin

Make symbolic links
ln -s /usr/bin/cc /usr/bin/gcc
ln -s /usr/bin/c++ /usr/bin/g++
ln -s /usr/bin/cc /usr/local/bin/gcc
ln -s /usr/bin/c++ /usr/local/bin/g++
[code]

*you may want to do this as root*
apex
 
Posts: 355
Joined: Sun Aug 05, 2001 7:00 pm

Re: C compiler cannot create executables.

Postby apex » Fri Oct 12, 2001 7:42 am

You may also want to take a look at config.log. It should show you exactly what is produicing the error. [img]images/icons/rolleyes.gif"%20border="0[/img]
apex
 
Posts: 355
Joined: Sun Aug 05, 2001 7:00 pm

Re: C compiler cannot create executables.

Postby akira » Fri Mar 01, 2002 11:20 am

Hi, there.

I just had the same problem, but it'll work if you set the proper argument for the C compiler. In my case, the following worked.

When you execute ./configure, make it like this:
env CC=cc ./configure

Hope it'll help...
akira
 
Posts: 2
Joined: Fri Mar 01, 2002 8:00 pm

Re: C compiler cannot create executables.

Postby <stevensm@earthlink.ne » Sun Feb 23, 2003 5:19 am

I just had this same error -- so frustrating!

My problem turned out to be that I lacked execute permission for /usr/bin/gcc and /usr/bin/g++ (or whatever they linked to).

I logged in as root and did a few commands like
chmod 755 /usr/bin/gcc
That fixed it (for now, at least).

To find out exactly where these gcc executables were, I typed
whereis gcc
whereis g++

Good Luck,
Mac
<stevensm@earthlink.ne
 

Re: C compiler cannot create executables.

Postby <xxyper> » Wed Sep 28, 2005 10:22 pm

i've tried all of the above and still no avail!!!
<xxyper>
 

Re: C compiler cannot create executables.

Postby xxyper » Wed Sep 28, 2005 10:27 pm

im now registered...hit me up with the 411
xxyper
 
Posts: 1
Joined: Wed Sep 28, 2005 7:00 pm
Location: jersey, usa

Re: C compiler cannot create executables.

Postby wayno » Mon Oct 17, 2005 2:18 pm

I've just had the same problem, and fixed it by setting the CC environment variable to gcc.

In /etc/profile:

CC="gcc"
export CC

I'm running 10.4, so you might need to change the way you set those variables in earlier versions.
wayno
 
Posts: 1
Joined: Mon Oct 17, 2005 7:00 pm
Location: Australia


Return to Compile Problems

Who is online

Users browsing this forum: No registered users and 11 guests

cron