c compiler cannot create executable on mac

柔情痞子 提交于 2019-12-22 08:10:12

问题


Everytime I try to install a package or software on my mac (Maverick) from a config file, it automatically fails when checking the C compiler. It says "configure: error: C compiler cannot create executables". Besides, Homebrew works perfectly. I attached an example of config.log. I haven't found any satisfaction in the related previous posts, I apologize if the issue was solved.

## ----------- ##
## Core tests. ##
## ----------- ##

configure:2530: checking for gcc
configure:2546: found /usr/local/bin/gcc
configure:2557: result: gcc
configure:2786: checking for C compiler version
configure:2795: gcc --version >&5
gcc (GCC) 4.8.0 20130113 (experimental)
Copyright (C) 2013 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:2806: $? = 0
configure:2795: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin12.2.0/4.8.0/lto-wrapper
Target: x86_64-apple-darwin12.2.0
Configured with: ../gcc-4.8-20130113/configure --enable-languages=c++,fortran
Thread model: posix
gcc version 4.8.0 20130113 (experimental) (GCC) 
configure:2806: $? = 0
configure:2795: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2806: $? = 1
configure:2795: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:2806: $? = 1
configure:2826: checking whether the C compiler works
configure:2848: gcc    conftest.c  >&5
ld: library not found for -lgcc_ext.10.5
collect2: error: ld returned 1 exit status
configure:2852: $? = 1
configure:2890: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2895: error: in `/Users/amidou/miriad_cvs':
configure:2897: error: C compiler cannot create executables
See `config.log' for more details

My Xcode version is 5.1, and I have the command line installed. Thanks in advance.

来源:https://stackoverflow.com/questions/22642539/c-compiler-cannot-create-executable-on-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!