gpt4 book ai didi

xcode - 运行配置命令时出现问题(检查 C 编译器是否工作...否)

转载 作者:行者123 更新时间:2023-12-02 02:12:42 25 4
gpt4 key购买 nike

我正在尝试运行配置命令,但它会生成以下错误:我正在运行 Mountain Lion OS X 10.8

checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking build system type... i386-apple-darwin12.0.0
checking host system type... i386-apple-darwin12.0.0
checking target system type... i386-apple-darwin12.0.0
checking whether the C compiler works... no
configure: error: in `/Users/aditya15417/php-5.4.6':
configure: error: C compiler cannot create executables
See `config.log' for more details.

知道为什么会出现这个错误吗?我已经安装了 Xcode 命令行工具,并且正在从终端运行配置命令。

我有 XCode 4.4,我很确定 gcc 已经安装了,因为它给我:

686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 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.

我试过:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

但效果不佳。这是我的 config.log 的链接如果需要的话。似乎从日志中找不到gcc4.2

configure:3524: checking for C compiler version
configure:3533: gcc-4.2 --version >&5
./configure: line 3535: gcc-4.2: command not found
configure:3544: $? = 127
configure:3533: gcc-4.2 -v >&5
./configure: line 3535: gcc-4.2: command not found
configure:3544: $? = 127
configure:3533: gcc-4.2 -V >&5
./configure: line 3535: gcc-4.2: command not found
configure:3544: $? = 127
configure:3533: gcc-4.2 -qversion >&5
./configure: line 3535: gcc-4.2: command not found
configure:3544: $? = 127
configure:3564: checking whether the C compiler works
configure:3586: gcc-4.2 conftest.c >&5
./configure: line 3588: gcc-4.2: command not found
configure:3590: $? = 127
configure:3628: result: no

这怎么可能?

最佳答案

我刚刚编辑了 .bash_profile,并注释掉了 CC= 行,因为我似乎认为它是以前 MacPorts 安装遗留下来的。

关于xcode - 运行配置命令时出现问题(检查 C 编译器是否工作...否),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12015226/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com