2012-10-11 97 views
4

我已經下載了CPP單元測試框架並嘗試編譯Android。但是,面對配置問題。我試圖使Standalone tool chain也試過配置,但其始終未能configure:error:配置Android時,C編譯器無法創建可執行文件

sh-4.1$ ./configure CXX=arm-linux-androideabi-g++ CC=arm-linux-androideabi-gcc CPP=arm-linux-androideabi-g++ CXXCPP=arm-linux-androideabi-g++ 
checking for a BSD-compatible install... /usr/bin/install -c 
checking whether build environment is sane... yes 
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p 
checking for gawk... gawk 
checking whether make sets $(MAKE)... yes 
checking whether make sets $(MAKE)... (cached) yes 
checking for a BSD-compatible install... /usr/bin/install -c 
checking for gcc... arm-linux-androideabi-gcc 
checking for C compiler default output file name... 
configure: error: C compiler cannot create executables 
See `config.log' for more details. 
sh-4.1$ arm-linux-androideabi-g++ 
arm-linux-androideabi-g++.exe: fatal error: no input files 
compilation terminated. 
sh-4.1$ 

我的編譯環境是NDKr8,Cygwin的,Windows7的-64。

我試圖通過的config.log去,並發現該錯誤是

arm-linux-androideabi-gcc.exe: error: CreateProcess: No such file or directory 

我嘗試了通過減少路徑長度等固定上述錯誤。但仍然無法解決。請讓我知道是否有人解決了類似的問題。

只是添加鏈接信息http://curl.haxx.se/mail/lib-2012-08/0184.html 但面臨與Cygwin出問題相同的問題。

D:\Test>arm-linux-androideabi-gcc Main.c 
arm-linux-androideabi-gcc: error: CreateProcess: No such file or directory 

D:\Test> 

即使在windows提示符下你也是如此觀察者,它也是同樣的問題。

-----編輯----- 1我 配置試圖在Ubuntu 12.04操作系統與下面的線

./configure --host=arm CXX=arm-linux-androideabi-g++ CC=arm-linux-androideabi-gcc CPP=arm-linux-androideabi-g++ CXXCPP=arm-linux-androideabi-g++ 

但是,讓這些錯誤

大部分
checking how to run the C preprocessor... arm-linux-androideabi-g++ 
configure: error: in `/mnt/hgfs/VMShare/gperftools-2.0_Android/gperftools-2.0': 
configure: error: C preprocessor "arm-linux-androideabi-g++" fails sanity check 
See `config.log' for more details. 

但ARM android Gcc編譯器的時代正在失敗。

configure:4216: arm-linux-androideabi-gcc -qversion >&5 
arm-linux-androideabi-gcc: error: unrecognized option '-qversion' 
arm-linux-androideabi-gcc: fatal error: no input files 
+2

「詳情參見 '的config.log'」。這是您應該查看的日誌文件。 – Mat

+0

@Mat:我只看到config.log文件。這是一個錯字:)。謝謝,我現在改爲Config.log在上面的味精中。 – Suman

+0

從技術上講,** ./configure **腳本是正確的:您的交叉編譯器無法創建可在Windows(或桌面Linux)上運行的可執行文件。有時,** ./configure **可以被_configured_理解,您正在使用交叉編譯器,並且不打算在執行構建的相同環境中啓動二進制文件。但我不確定單元測試框架可以用於這種情況。要分析特定情況,如果您發佈要嘗試構建的項目(URL,版本等將會有所幫助),這可能很有用。 –

回答

0

我沒有與特定的設置經驗,但是當我得到這個錯誤,我加入海灣合作委員會的bin文件夾添加到系統路徑固定它,另外,必須有每個可執行文件的版本在gcc的bin目錄中沒有前綴(例如g ++。exe,ld.exe ...)。這解決了我的問題。我在更改路徑後也登出/打開,但不知道是否有必要。

我來到這裏的想法: http://forums.codeblocks.org/index.php?topic=18100.0

1

給正確的路徑和環境。

示例設置:

export NDK=/develop/android/android-ndk-r9b 
export SYSROOT=$NDK/platforms/android-18/arch-x86 
export CC="$NDK/toolchains/x86-4.7/prebuilt/linux-x86/bin/i686-linux-android-gcc --sysroot=$SYSROOT" 

export CFLAGS="--sysroot=$SYSROOT " 
export LDFLAGS="--sysroot=$SYSROOT " 
相關問題