【发布时间】:2014-03-16 05:09:46
【问题描述】:
我正在尝试使用 ndk 为 android 编译 ffmpeg。操作系统:Ubuntu 13.10。我跟着this 教程。但是当我运行 build_android.sh 它给了我以下错误-
sujith@Vaio:~$ cd /home/sujith/ndk9d/sources/ffmpeg
sujith@Vaio:~/ndk9d/sources/ffmpeg$ sudo chmod +x build_android.sh
[sudo] password for sujith:
sujith@Vaio:~/ndk9d/sources/ffmpeg$ ./build_android.sh
/home/sujith/sujith/ndk9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux- x86_64/bin/arm-linux-androideabi-gcc is unable to create an executable file.
C compiler test failed.
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.
Makefile:2: config.mak: No such file or directory
Makefile:53: /common.mak: No such file or directory
Makefile:93: /libavutil/Makefile: No such file or directory
Makefile:93: /library.mak: No such file or directory
Makefile:95: /doc/Makefile: No such file or directory
Makefile:178: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
Makefile:2: config.mak: No such file or directory
Makefile:53: /common.mak: No such file or directory
Makefile:93: /libavutil/Makefile: No such file or directory
Makefile:93: /library.mak: No such file or directory
Makefile:95: /doc/Makefile: No such file or directory
Makefile:178: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
Makefile:2: config.mak: No such file or directory
Makefile:53: /common.mak: No such file or directory
Makefile:93: /libavutil/Makefile: No such file or directory
Makefile:93: /library.mak: No such file or directory
Makefile:95: /doc/Makefile: No such file or directory
Makefile:178: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'. Stop.
这是我的 build_android.sh
#!/bin/bash
NDK=$HOME/sujith/ndk9d
SYSROOT=$NDK/platforms/android-9/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64
function build_one
{
./configure \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-doc \
--disable-symver \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_one
我的 build_android.sh 位于 ffmpeg 源码根目录。 如何解决这个问题?请帮帮我..
【问题讨论】:
-
同样的错误。使用 ndk32 和 ndk64。
-
config.log 中有什么错误?
-
请确保此文件存在且可执行:/home/sujith/sujith/ndk9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi -gcc
-
报错信息是“... not found C compiler test failed”,你可以尝试手动运行上面的命令看看会发生什么。
标签: android android-ndk ffmpeg makefile