c编译器无法在mac上创建可执行文件

c编译器无法在mac上创建可执行文件,c,gcc,compilation,osx-mavericks,C,Gcc,Compilation,Osx Mavericks,每次我试图从配置文件在mac(Maverick)上安装软件包或软件时,在检查C编译器时都会自动失败。它说“配置:错误:C编译器无法创建可执行文件”。除此之外,自制软件工作得非常好。我附上了config.log的一个示例。我在之前的相关帖子中没有发现任何满意,如果问题得到解决,我道歉 ## ----------- ## ## Core tests. ## ## ----------- ## configure:2530: checking for gcc configure:2546: foun

每次我试图从配置文件在mac(Maverick)上安装软件包或软件时,在检查C编译器时都会自动失败。它说“配置:错误:C编译器无法创建可执行文件”。除此之外,自制软件工作得非常好。我附上了config.log的一个示例。我在之前的相关帖子中没有发现任何满意,如果问题得到解决,我道歉

## ----------- ##
## 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

我的Xcode版本是5.1,我已经安装了命令行。提前感谢。

C编译器
/usr/local/bin/gcc
不是来自Xcode。它可能是通过自制或MacPorts或类似方式安装的。它坏了。尝试卸载它;这将使
configure
取而代之的是
clang
的Xcode副本。如果出于某种原因特别需要gcc,您可以在以后重新安装gcc,但我强烈建议您首先确保有一个基于Xcode的工作工具链。值得注意的是,5.1 cmdline实用程序安装了一个gcc垫片,该垫片使用g++配置模式有效地“运行”clang。所述gcc符号链接位于其所属的/usr/bin/gcc中。作为一个简单的测试运行
/usr/bin/gcc--version