3

configure コマンドを実行しようとしていますが、次のエラーが発生します: 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 コマンド ライン ツールをインストールし、ターミナルから configure コマンドを実行しています。

私は 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

これはどのように可能ですか?

4

3 に答える 3

2

.bash_profile を編集し、CC= 行をコメントアウトしました。これは、以前の MacPorts インストールから残っていると思われるためです。

于 2012-12-17T20:09:35.827 に答える
0

.profile ファイルに export CFLAGS="-arch ppc -arch x86_64 -g -O2 -m64" という行がありました。-arch ppc を削除した後、./configure を正常に実行できました。

于 2013-03-13T16:50:54.927 に答える
0

gcc-4.2config.log ファイルから、存在しないコンパイラを使用しようとしています。存在するコンパイラを使用するように指示する必要があります。これは通常、環境変数を設定することによって行われますCC

于 2012-08-18T02:48:48.697 に答える