编译x86

编译脚本

#!/bin/bash NDK=/tmp/frank/android-ndk-r14b SYSROOT=$NDK/platforms/android-14/arch-x86/ TOOLCHAIN=$NDK/toolchains/x86-4.9/prebuilt/linux-x86_64 function build_x86 { ./configure \ --prefix=$PREFIX \ --enable-shared \ --disable-static \ --disable-doc \ --disable-ffserver \ --enable-cross-compile \ --cross-prefix=$TOOLCHAIN/bin/i686-linux-android- \ --target-os=linux \ --arch=x86 \ --enable-cross-compile \ --sysroot=$SYSROOT \ --extra-cflags="" \ --extra-ldflags="" \ --extra-libs="" } CPU=x86 PREFIX=$(pwd)/android/$CPU build_x86

问题1 yasm/nasm not found or too old. Use --disable-yasm for a crippled build.
解决方案: yasm是汇编编译器,因为ffmpeg中为了提高效率用到了汇编指令,比如MMX和SSE。解决这个问题方面有两个:
【编译x86】1、在网上下载一个yasm.exe并安装在mingw/bin下面,编译代码时你注意看,会发现asm后缀的文件用的编译器是yasm,c文件用的是gcc;
2、不使用汇编指令,在配置时加上,即./configure --disable-yasm yasm
下载地址:http://yasm.tortall.net/Download.html
问题2 error: libavutil/../compat/strtod.o
解决方案: 去FFmpeg的compat目录下删除掉strdod.o文件,然后make clean

    推荐阅读