Need help! error: C compiler cannot create executables
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Need help! error: C compiler cannot create executables
i want to install gtk+2.4.3
when i run ./configure after uncompress the tarball, i get
error: C compiler cannot create executables
what is the problem?
configure:1601: checking for a BSD-compatible install
configure:1656: result: /usr/bin/install -c
configure:1667: checking whether build environment is sane
configure:1710: result: yes
configure:1743: checking for gawk
configure:1759: found /bin/gawk
configure:1769: result: gawk
configure:1779: checking whether make sets $(MAKE)
configure:1799: result: yes
configure:2027: checking build system type
configure:2045: result: i686-pc-linux-gnu
configure:2053: checking host system type
configure:2067: result: i686-pc-linux-gnu
configure:2077: checking for native Win32
configure:2088: result: no
configure:2137: checking for gcc
configure:2153: found /usr/bin/gcc
configure:2163: result: gcc
configure:2407: checking for C compiler version
configure:2410: gcc --version </dev/null >&5
gcc (GCC) 3.4.1 (Mandrake Linux (Cooker) 3.4.1-0.1mdk)
Copyright (C) 2004 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:2413: $? = 0
configure:2415: gcc -v </dev/null >&5
Reading specs from /usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/specs
Configured with: ../configure --prefix=/usr --libdir=/usr/lib --with-slibdir=/lib --mandir=/usr/share/man --in
fodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-__
cxa_atexit --enable-clocale=gnu --disable-libunwind-exceptions --enable-languages=c,c++,f77,objc,java --host=i
586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.4.1 (Mandrake Linux (Cooker) 3.4.1-0.1mdk)
configure:2418: $? = 0
configure:2420: gcc -V </dev/null >&5
gcc: `-V' option must have argument
configure:2423: $? = 1
configure:2446: checking for C compiler default output file name
configure:2449: gcc conftest.c >&5
/usr/bin/ld: unrecognized option '--as-needed'
/usr/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
configure:2452: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "gtk+"
| #define PACKAGE_TARNAME "gtk+"
| #define PACKAGE_VERSION "2.4.3"
| #define PACKAGE_STRING "gtk+ 2.4.3"
| #define PACKAGE_BUGREPORT "http://bugzilla.gnome.org/enter_bug.cgi?product=gtk+"
| #define GETTEXT_PACKAGE "gtk20"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2491: error: C compiler cannot create executables
See `config.log' for more details.
Looks like the problem is with ld, the linker. What version of ld do you have? Looks like it's choking on one of the options passed to it. Can you compile this simple C program:
#include <stdio.h>
int main(void)
{
puts("Hello");
return 0;
}
Copy it into a file foo.c and do "gcc foo.c -o foo" (no quotes) and see if it produces an executable called foo that you can run. If it reports a linker error, there's some problem between your compiler and your linker.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.