web-dev-qa-db-ja.com

configure:エラー:Cコンパイラは実行可能ファイルを作成できません

私はstackoverflowでいくつかの同様の質問をチェックしましたが、まだ答えが見つかりませんでした。

Lion OSXにmemcachedを ここに表示 としてインストールしようとしています。

ここに私が得ているものがあります:

j-court-demones-macbook-pro:libevent-1.4.12-stable jcourtdemone$ ./configure; make
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... 
configure: error: in `/tmp/libevent-1.4.12-stable':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make: *** No targets specified and no makefile found.  Stop.

いくつかの場所で推奨されているようにXcodeを再インストールしましたが、サイコロはありません。

ここに私のconfig.logがあります:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.63.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = j-court-demones-macbook-pro.local
uname -m = x86_64
uname -r = 11.3.0
uname -s = Darwin
uname -v = Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64

/usr/bin/uname -p = i386
/bin/uname -X     = unknown

/bin/Arch              = unknown
/usr/bin/Arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
     Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64
Kernel configured for up to 8 processors.
4 processors are physically available.
8 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1 2 3 4 5 6 7
Primary memory available: 4.00 gigabytes
Default processor set: 109 tasks, 599 threads, 8 processors
Load average: 0.98, Mach factor: 7.01
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /opt/local/bin
PATH: /opt/local/sbin
PATH: /opt/local/bin
PATH: /opt/local/sbin
PATH: /usr/bin
PATH: /Developer/usr/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/bin
PATH: /usr/X11/bin


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

configure:2077: checking for a BSD-compatible install
configure:2145: result: /usr/bin/install -c
configure:2156: checking whether build environment is sane
configure:2199: result: yes
configure:2224: checking for a thread-safe mkdir -p
configure:2263: result: ./install-sh -c -d
configure:2276: checking for gawk
configure:2306: result: no
configure:2276: checking for mawk
configure:2306: result: no
configure:2276: checking for nawk
configure:2306: result: no
configure:2276: checking for awk
configure:2292: found /usr/bin/awk
configure:2303: result: awk
configure:2314: checking whether make sets $(MAKE)
configure:2336: result: yes
configure:2575: checking for gcc
configure:2591: found /Developer/usr/bin/gcc
configure:2602: result: gcc
configure:2834: checking for C compiler version
configure:2842: gcc --version >&5
i686-Apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5484)
Copyright (C) 2005 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:2846: $? = 0
configure:2853: gcc -v >&5
Using built-in specs.
Target: i686-Apple-darwin9
Configured with: /var/tmp/gcc/gcc-5484~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-Apple-darwin9 --with-Arch=Apple --with-tune=generic --Host=i686-Apple-darwin9 --target=i686-Apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5484)
configure:2857: $? = 0
configure:2864: gcc -V >&5
gcc-4.0: argument to `-V' is missing
configure:2868: $? = 1
configure:2891: checking for C compiler default output file name
configure:2913: gcc    conftest.c  >&5
ld: library not found for -lcrt1.10.5.o
collect2: ld returned 1 exit status
configure:2917: $? = 1
configure:2955: result: 
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE "libevent"
| #define VERSION "1.4.12-stable"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2961: error: in `/tmp/libevent-1.4.12-stable':
configure:2964: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_F77_set=
ac_cv_env_F77_value=
ac_cv_env_FFLAGS_set=
ac_cv_env_FFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_Host_alias_set=
ac_cv_env_Host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=awk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${Shell} /tmp/libevent-1.4.12-stable/missing --run aclocal-1.10'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${Shell} /tmp/libevent-1.4.12-stable/missing --run tar'
AR=''
AUTOCONF='${Shell} /tmp/libevent-1.4.12-stable/missing --run autoconf'
AUTOHEADER='${Shell} /tmp/libevent-1.4.12-stable/missing --run autoheader'
AUTOMAKE='${Shell} /tmp/libevent-1.4.12-stable/missing --run automake-1.10'
AWK='awk'
BUILD_WIN32_FALSE=''
BUILD_WIN32_TRUE=''
CC='gcc'
CCDEPMODE=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
DSYMUTIL=''
ECHO='/bin/echo'
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
EXEEXT=''
F77=''
FFLAGS=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIBTOOL_DEPS=''
LN_S=''
LTLIBOBJS=''
MAKEINFO='${Shell} /tmp/libevent-1.4.12-stable/missing --run makeinfo'
MKDIR_P='./install-sh -c -d'
NMEDIT=''
OBJEXT=''
PACKAGE='libevent'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
SED=''
SET_MAKE=''
Shell='/bin/sh'
STRIP=''
VERSION='1.4.12-stable'
ac_ct_CC='gcc'
ac_ct_CXX=''
ac_ct_F77=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include=''
am__isrc=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
Host=''
Host_alias=''
Host_cpu=''
Host_os=''
Host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='$(Shell) /tmp/libevent-1.4.12-stable/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(top_builddir)/./install-sh -c -d'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE "libevent"
#define VERSION "1.4.12-stable"

configure: exit 77
129
CourtDemone

開発者ツールの古いセットがあります。 gccはそのバージョンを4.0.1として報告しています。これは、古いバージョンのOSからの移行では残される場合があります。 Xcode 4.3.xをインストールした場合は、起動して設定に移動し、[ダウンロード]タブを選択して、コマンドラインツールパッケージの横にある[インストール]をクリックする必要があります。

105
Ken Thomases

10.8をインストールし、Xcode 4.4にコマンドラインツールをインストールしましたが、まだこのエラーが発生していました。 Xcodeを再インストールするのではなく、config.logに関連する行が2つあることに気付きました。

configure:5130: checking for C compiler version
configure:5139: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc --version >&5

その道は私には存在しませんでした。代わりに私は持っていた:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain

Cコンパイラ( "cc")は、xctoolchainディレクトリ内にあります。 XcodeDefault.xctoolchainを指すOSX10.8.xctoolchainのシンボリックリンクを作成し、それを修正しました。これで、memcachedインストールスクリプトはコンパイラのバージョンを検出し、処理を続行できます。

cd /Applications/Xcode.app/Contents/Developer/Toolchains
Sudo ln -s XcodeDefault.xctoolchain OSX10.8.xctoolchain

コメントで示唆されているように、Yosemite(10.10)またはMavericks(10.9)でこの問題が発生している場合、上記のsymlinkコマンドを更新して、その特定のバージョン(OSX10.9.xctoolchainまたはOSX10.10.xctoolchain)を指すことができます。

139
stereoscott

このエラーメッセージが表示された場合、アップグレード後にまだXcodeライセンス契約に同意していない可能性があります。

まず、コマンドラインツールをアップグレードしたことを確認してください。

$ xcode-select --install

Appleは、これらのツールを使用する前に、ライセンスに同意することを望んでいます。

$ gcc
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via Sudo.

$ Sudo gcc
You have not agreed to the Xcode license agreements. You must agree to both license agreements below in order to use Xcode.
[...]

受け入れた後、コマンドラインツールは期待どおりに動作します。

67
konrad

私はすでにXcodeにコマンドラインツールをインストールしていましたが、私はまだエラーを出しました:

line 3619: /usr/bin/gcc-4.2: No such file or directory

which gccと入力すると、戻りました

/usr/bin/gcc

gcc -vに入ったとき、たくさんのものを手に入れました

..  
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

だから私はシンボリックリンクを作成しました:

cd /usr/bin
Sudo ln -s gcc gcc-4.2

そしてうまくいきました!

(config.logファイルは、makeが何かを構築しようとしているディレクトリにあります)

12
Rimian

Apacheをビルドするときにこの問題が発生しました。私が使用したソリューションはモスタファと同じで、2つの変数をエクスポートする必要がありました。

export CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
CPP='/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -E'

これは1つのMac OSX Mavericksでした

11
David Williams

私にとっては、gcc -vで強調されているgccの問題でした。最近Xcodeをアップグレードすることになりました この投稿Sudo xcode-select -switch /Applications/Xcode.appを行うように言われ、問題を修正しました。

3
homerjam

コンパイラの構成として「clang」を設定すると、私のために機能するはずです:

export CC=clang
pip install --no-clean pycrypto
3
yndolok

私はこのページのすべてを猛烈に読んで、次の解決策を見つけたいと思っています。

"configure: error: C compiler cannot create executables"

私の問題は「タイピング」問題であり、CFLAGSに関連していたため、最終的には何も機能しませんでした。私の.bash_profileファイルには:

export ARM_Arch="arm64”
export CFLAGS="-Arch ${ARM_Arch}"

ご覧のとおり--- export ARM_Arch = "arm64" ---最後の引用符は最初の引用符と同じではありません。最初の引用符( ")は有効ですが、2番目の引用符( ”)ではありません。
TextEditの使用を間違えたため(MacOSで作業しています)、これは明らかにSmartQuotesと呼ばれる機能です。引用記号は、それ。
教訓:適切なテキストエディタを使用...

2
Florin Odagiu

最初に使用してgccパスを取得します

コマンド:which gcc

出力:/ usr/bin/gcc

私は同じ問題を抱えていました、以下のコマンドでgccパスを設定してインストールしてください

CC =/usr/bin/gcc rvm install 1.9.

後で「Rubyはドキュメントなしでビルドされました」というコマンドが表示された場合

rvm docs generate-ri

2
Gurudath BN

RVM/Rubyが問題(ミドルマン/グルント)を作成しているために誰かがここに来ている場合、問題を解決しました。

PS。 steroscottの答えはしばらく前に私の問題を修正しました...今回はそうではありません。

私の場合、rvmはダウンロードしたgccをhomebrew経由で使用しようとしています。 gcc(私はgcc46)のアンインストールを実行し、Rubyインストール(古いプロジェクトは古いRuby v)のコードを再実行しました

$ brew uninstall gcc46

$ rvm install 1.9.3

要件を確認するそのプロセス中に、自動的に新しいgccが取得され、ブームになりましたが、すべて正常に動作しています。ああ、rvmコマンドからのgccのインストールは、テキストを捨てずに約10〜15分かかることがあります。フリーズしません:)

2
jasonsemko

Xcodeアプリケーション名にスペースが含まれていないことを確認してください(古いバージョンを保持している場合に発生する可能性があります。たとえば、「Xcode 4.app」に名前を変更します)。ビルドツールはXcodeバンドルパス内で参照され、多くのスクリプトはスペースを含む参照を適切に処理できません。

0
coderSeb

Clang iOSクロスコンパイラについて

問題はmiphoneos-version-min=5.0にあることがわかりました。 miphoneos-version-min=8.0に変更しました。今では動作します。

単純なtest.cファイルを作成し、ログにコマンドを書き込むことでコンパイルすることをお勧めします。

0
Vyacheslav

私の場合、xcode-select --installを試しましたが、ストアからは入手できないと書かれています。次に、Rimianに触発されて、gccをチェックしました:gcc -vそして、私は同意しなかったというメッセージを受け取りました。

その時点から、私はgcc -vからの合意プロセスに従いました。

0
C-Rock