【问题标题】:Building GMP with NDK使用 NDK 构建 GMP
【发布时间】:2020-05-08 02:31:22
【问题描述】:

我正在尝试在 Windows 上使用 msys2 通过 ndk 工具链为 Android 构建 gmp。但我不断收到此错误:

configure: error: Cannot find a build system compiler

我什至不确定什么是构建系统编译器? NDK 中的哪个可执行文件?如何指定?

Running configure step for gmp-6.1.2
sh configure --enable-static --disable-shared --with-pic --prefix=C:/Developer/AppPlugin/build/android/deps --with-sysroot=/C/Developer/AppPlugin/build/android/toolchain-arm-21/sysroot --host=arm-linux-androideabi
configure: loading site script C:/msys64/mingw64/etc/config.site
checking build system type... x86_64-w64-mingw32
checking host system type... arm-unknown-linux-androideabi
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-androideabi-strip... C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=32
checking whether C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang is gcc... yes
checking compiler C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang -Os -IC:/Developer/AppPlugin/build/android/deps/include -marm -mtune=cortex-a8 -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fPIC -D__ANDROID_API__=21 --sysroot=C:/Developer/AppPlugin/build/android/toolchain-arm-21/sysroot ... yes
checking whether ARM gcc unsigned division works... yes
checking for arm-linux-androideabi-gcc... C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang accepts -g... yes
checking for C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang option to accept ISO C89... none needed
checking whether C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang understands -c and -o together... yes
checking for C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang option to accept ISO C99... none needed
checking for C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang option to accept ISO Standard C... (cached) none needed
checking how to run the C preprocessor... C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang -E
checking build system compiler C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang... no
checking build system compiler C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang -Os -IC:/Developer/AppPlugin/build/android/deps/include -marm -mtune=cortex-a8 -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fPIC -D__ANDROID_API__=21 --sysroot=C:/Developer/AppPlugin/build/android/toolchain-arm-21/sysroot ... no
checking build system compiler cc... no
checking build system compiler gcc... no
checking build system compiler c89... no
checking build system compiler c99... no
configure: error: Cannot find a build system compiler
Failed on configure step for gmp-6.1.2: sh configure --enable-static --disable-shared --with-pic --prefix=C:/Developer/AppPlugin/build/android/deps --with-sysroot=/C/Developer/AppPlugin/build/android/toolchain-arm-21/sysroot --host=arm-linux-androideabi

【问题讨论】:

  • GMP 想要构建一些在你的 windows 机器上运行的程序,以便它可以运行它们来生成一些表,然后将它们包含在你的 android 库中。所以它还需要一个本机编译器。至少我是这样理解这个信息的。 gmplib.org/manual/Build-Options.html#index-CC_005fFOR_005fBUILD
  • 尝试在日志文件中查找此步骤失败的原因:checking build system compiler C:/Developer/AppPlugin/build/android/toolchain-arm-21/bin/arm-linux-androideabi-clang... no。 “配置”脚本会留下一些日志。为了检查编译器,configure 脚本编译了一些代码,日志中应该有特定的错误。

标签: android c cmake android-ndk gmp


【解决方案1】:

我需要为我的 gcc 可执行文件设置 as= 命令行选项。

【讨论】:

  • 这是什么意思?
猜你喜欢
  • 2014-06-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-11-04
  • 1970-01-01
  • 1970-01-01
  • 2016-08-15
  • 1970-01-01
相关资源
最近更新 更多