我正在尝试为 Android 编译 x264
库,遵循 post .
我已经克隆了 x264 项目 git clone git://git.videolan.org/x264.git
并尝试使用以下配置进行编译:
NDK=~/development/android-ndk-r10c
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64
PLATFORM=$NDK/platforms/android-21/arch-arm
./configure \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--sysroot=$PLATFORM \
--host=arm-linux \
--enable-pic \
--enable-static \
--disable-cli
问题是我得到一个 No working C compiler found.
错误。
conftest.log
输出:
$ cat conftest.log
./configure: line 153: arm-linux-androideabi-gcc: command not found
但是 arm-linux-androideabi-gcc
是工具链的 bin 文件夹!!
看这个其他question看起来出于某种原因,即使该文件存在,因为它是 64 位 Mac,它不会执行 arm-linux-androideabi-gcc
文件并将返回这个奇怪的错误和日志。
我使用的是 Mac OS X 10.10,我已经安装了 XCode 命令行工具:
$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
海湾合作委员会版本:
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix
谁能告诉我如何解决这个问题?
最佳答案
你不应该设置 --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi-
,你应该首先将该目录添加到你的路径,使用 export PATH= $TOOLCHAIN/bin:$PATH
,并且仅指定 --cross-prefix=arm-linux-androideabi-
(就像您链接到的帖子中一样)。
关于android - 在 Mac 上编译 x264 : "No working C compiler found" and "arm-linux-androideabi-gcc: command not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27198166/