Discussion:
why C compiler cannot create executables?
(too old to reply)
a***@ducksburg.ca.us
2008-03-27 19:39:35 UTC
Permalink
Just a question on a weird behaviour of C compiler.
If I'm off place, please give the right place where I can post.

Why C compiler cannot create executables (both as root and as user) ?

-------------------------------------------------
Running configure for building software, I was stymied since I got this:
-------------------------------------------------
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler
cannot create executables
See `config.log' for more details.

-------------------------------------------------------
And in config.log I found:

gcc (GCC) 4.1.2
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

configure:2029: $? = 0
configure:2031: gcc -v </dev/null >&5
Reading specs from /usr/lib/gcc/i486-slackware-linux/4.1.2/specs
Target: i486-slackware-linux
Configured with: ../gcc-4.1.2/configure --prefix=/usr --enable-shared
--enable!
Thread model: posix
gcc version 4.1.2
configure:2034: $? = 0
configure:2036: gcc -V </dev/null >&5
gcc: '-V' option must have argument
configure:2039: $? = 1
configure:2063: checking for C compiler default output
configure:2066: gcc conftest.c >&5
/usr/lib/gcc/i486-slackware-linux/4.1.2/../../../crt1.o(.text+0xc): In
functio!
: undefined reference to `__libc_csu_fini'
/usr/lib/gcc/i486-slackware-linux/4.1.2/../../../crt1.o(.text+0x11): In
functi!
: undefined reference to `__libc_csu_init'
collect2: ld returned 1 exit status
configure:2069: $? = 1
configure: failed program was:
| #line 2042 "configure"
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "goben"
| #define VERSION "0.1.1"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2108: error: C compiler cannot create executables
See `config.log' for more details.
**********************************************************


Thanks for any reply or suggestion,
Aku Ankka
Stephen Gonedes
2008-05-25 05:13:54 UTC
Permalink
aku-***@ducksburg.ca.us writes:

< Just a question on a weird behaviour of C compiler.
< If I'm off place, please give the right place where I can post.
< Why C compiler cannot create executables (both as root and as user) ?
Try the following and see if it works.

(unset CC; echo -e "#include <stdio.h>\nmain (void) {return \
(0); }" > tem.c ; /usr/bin/gcc -o tem tem.c && rm -v tem && rm -v tem.c)


< -------------------------------------------------
< Running configure for building software, I was stymied since I got this:
< -------------------------------------------------
< checking for gcc... gcc
< checking for C compiler default output... configure: error: C compiler
< cannot create executables
< See `config.log' for more details.
Could be a typo in the configure script. What program are you trying to
compile. also a `whereis gcc`, might have several around.

or

(unset CC; echo -e "#include <stdio.h>\nmain (void) {return
(0); }" > tem.c ; gcc -o tem tem.c && readelf -l tem | grep '.so' ; rm -v
tem && rm -v tem.c)

Should see something like this I hope.
=> [Requesting program interpreter: /lib/ld-linux.so.2]


The specs file is a bit crazy. I would make a backup before trying to fiddle
with it. The LFS takes you step by step in bootstrapping gcc. It takes a
long time and it better to not have several versions unless necessary or
intended, IMHO.

Post what program and maybe I can take a quick look. Sometimes the configure
script is overkill for some programs, but it sure is better than building a
ghostscript makefile :)



< Thanks for any reply or suggestion,
< Aku Ankka

hope to help...

Continue reading on narkive:
Loading...