【问题标题】:'configure' failing with Android NDK standalone toolchainAndroid NDK 独立工具链的“配置”失败
【发布时间】:2012-02-15 00:03:57
【问题描述】:

我正在尝试使用 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

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

【问题讨论】:

标签: gcc android-ndk makefile configure autoconf


【解决方案1】:

在我看来,这看起来很糟糕:

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 构建设置环境的方式:

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=$SYSROOT 添加到CFLAGSCPPFLAGS 和/或CXXFLAGS

现在你需要告诉蜘蛛猴configure你正在交叉编译:

./configure --build=x86_64-unknown-linux-gnu --host=arm-linux-androideabi --target=arm-linux-androideabi

【讨论】:

  • --sysroot=$SYSROOT 还需要转到预处理器标志变量CPPFLAGS。请更新您的答案以获得支持。
【解决方案2】:

好像找不到arm-linux-androideabi-g++。尝试在 NDK 文件夹中搜索它并将目录添加到您的PATH

我的在这里:

ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++

【讨论】:

  • 这也是我的想法,但arm-linux-androideabi-g++ 确实出现在我的PATH 中,如果我只是在命令行外运行arm-linux-androideabi-g++,它会发现它已经足够好了。
  • 您是否设置了ANDROID_NDK_ROOT 环境变量?
  • 是的,ANDROID_NDK_ROOT 设置为 /home/afeder/android/android-ndk-r7-crystax-4
猜你喜欢
  • 2013-10-09
  • 2013-07-17
  • 2014-06-27
  • 2012-02-21
  • 2019-02-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多