0

MBP (10.7.3) Xcode 4.3.1 工作,它编译 ac 程序。

运行 sudo port -v selfupdate BELOW 是 console.log 的一部分

configure:2735: result: i386-apple-darwin11.3.0
configure:2763: checking MacPorts version
configure:2766: result: 2.0.4
configure:2799: checking for sw_vers
configure:2817: found /usr/bin/sw_vers
configure:2829: result: /usr/bin/sw_vers
configure:2839: checking for defaults
configure:2857: found /usr/bin/defaults
configure:2869: result: /usr/bin/defaults
configure:2879: checking for xcode-select
configure:2897: found /usr/bin/xcode-select
configure:2909: result: /usr/bin/xcode-select
configure:2919: checking Mac OS X version
configure:2922: result: 10.7.3
configure:2945: checking Xcode location
configure:2948: result: /Applications/Xcode.app/Contents/Developer
configure:3036: checking for gcc
configure:3063: result: /usr/bin/cc
configure:3292: checking for C compiler version
configure:3301: /usr/bin/cc --version >&5
./configure: line 3303: /usr/bin/cc: No such file or directory
configure:3312: $? = 127
configure:3301: /usr/bin/cc -v >&5
./configure: line 3303: /usr/bin/cc: No such file or directory
configure:3312: $? = 127
configure:3301: /usr/bin/cc -V >&5
./configure: line 3303: /usr/bin/cc: No such file or directory
configure:3312: $? = 127
configure:3301: /usr/bin/cc -qversion >&5
./configure: line 3303: /usr/bin/cc: No such file or directory
configure:3312: $? = 127
configure:3332: checking whether the C compiler works
configure:3354: /usr/bin/cc    conftest.c  >&5
./configure: line 3356: /usr/bin/cc: No such file or directory
configure:3358: $? = 127
configure:3396: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "MacPorts"
| #define PACKAGE_TARNAME "macports"
| #define PACKAGE_VERSION "2.0.4"
| #define PACKAGE_STRING "MacPorts 2.0.4"
| #define PACKAGE_BUGREPORT "macports-dev@lists.macosforge.org"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3401: error: in `/opt/local/var/macports/sources/rsync.macports.org/release/base':
configure:3403: error: C compiler cannot create executables
See `config.log' for more details

我需要做什么?Xcode 链接到 C 编译器,并且端口知道 Xcode 位置。

非常感谢任何帮助。

4

1 回答 1

1

Xcode 默认不会安装所有命令行工具,即使您过去安装过它们,您也可能会在 Xcode 升级后发现它们丢失了。

在 Xcode 中,转到 Preferences -> Downloads 并确保已安装“命令行工具”。这是一个额外的 115MB 下载。

于 2012-08-03T16:16:27.460 回答