gcc - Android NDK 独立工具链的“配置”失败

标签 gcc android-ndk makefile configure autoconf

我正在尝试使用 Android NDK 独立编译器工具链构建一些东西,但我收到此错误:

Updating bundled third-party dependencies...

bash -c 'mkdir -p output/{debug,release,test}/{FCollada/{FCDocument,FMath,FUtils,FColladaTest/{FCTestAssetManagement,FCTestExportImport,FCTestXRef}},FColladaPlugins/FArchiveXML}'
cp output/libFColladaSD.a ../lib/libFColladaSD.a
cp output/libFColladaSR.a ../lib/libFColladaSR.a

Building SpiderMonkey...

SpiderMonkey build options: --disable-tests         
loading cache ./config.cache
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking build system type... x86_64-unknown-linux-gnu
checking for mawk... mawk
checking for perl5... no
checking for perl... /usr/bin/perl
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for c++... arm-linux-androideabi-g++
checking whether the C++ compiler (arm-linux-androideabi-g++  ) works... no
configure: error: installation or configuration problem: C++ compiler cannot create executables.
ERROR: SpiderMonkey build failed

这是什么config.log说:http://pastebin.com/5AFZG4CX

我的 ANDROID_NDK_ROOT设置如下:
afeder@ubuntu:~/android/0ad/build/workspaces$ echo $ANDROID_NDK_ROOT
/home/afeder/android/android-ndk-r7-crystax-4

可能是什么原因或我如何调试它?谢谢你。

最佳答案

对我来说,这看起来很糟糕:

checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking build system type... x86_64-unknown-linux-gnu

以下是我为 Android NDK build设置环境的方法:
export CROSS_COMPILE=arm-linux-androideabi
export CC=${CROSS_COMPILE}-gcc
export CXX=${CROSS_COMPILE}-g++

... 其他需要的 binutils ...
export NDK=/home/afeder/android/android-ndk-r7-crystax-4
export SYSROOT=$NDK/platforms/android-8/arch-arm
PATH=$PATH:$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin

确保并添加 --sysroot=$SYSROOTCFLAGS , CPPFLAGS ,和/或 CXXFLAGS .

现在你需要告诉蜘蛛猴configure您正在交叉编译:
./configure --build=x86_64-unknown-linux-gnu --host=arm-linux-androideabi --target=arm-linux-androideabi

关于gcc - Android NDK 独立工具链的“配置”失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8941143/

相关文章:

gcc - 解释 gcc 映射文件

gcc - 函数序言中的 sub esp、eax 的作用是什么?

android - 如何在 Android 上的崩溃转储中获得更多调用堆栈深度?

c - GCC错误: Could not find or load main class com. intellij.idea.Main编译C

c++ - 使用 cmake/mingw 输出 DLL 而不是 .exe

c++ - Mingw-w64 和 TDM-GCC 一个简单的 GDI 项目的区别

gcc - 由GCC创建的exe文件没有权限?

java - Android 运行时错误 : Library 'libmmparser.so' not found

android - 使用 ANativeWindow 的 SurfaceTexture/Surface 映射

c++ - C++中修改的.h文件不需要重新编译?