我正在尝试使用android ndk18b工具链构建ffmpeg。我的配置如下所示。
TOOLCHAIN_PREFIX=/home/git/ndks/stand_alone_toolchain_ndk16b
NDK_SYSROOT=$TOOLCHAIN_PREFIX/sysroot
NDK_ARCH='arm'
NDK_ABIARCH='arm-linux-androideabi'
target_host=arm-linux-androideabi
export CPP="${CROSS_PREFIX}clang++"
export PATH=${TOOLCHAIN_PREFIX}/bin:$PATH
export CROSS_PREFIX=${TOOLCHAIN_PREFIX}/bin/${NDK_ABIARCH}-
export CC="${CROSS_PREFIX}clang"
export CXX="${CROSS_PREFIX}clang++"
export AS="${CROSS_PREFIX}clang"
export AR="${CROSS_PREFIX}ar"
export LD="${CROSS_PREFIX}ld"
export RANLIB="${CROSS_PREFIX}ranlib"
export STRIP="${CROSS_PREFIX}strip"
export OBJDUMP="${CROSS_PREFIX}objdump"
export CPP="${CROSS_PREFIX}cpp"
export GCONV="${CROSS_PREFIX}gconv"
export NM="${CROSS_PREFIX}nm"
export SIZE="${CROSS_PREFIX}size"
# Tell configure what flags Android requires.
export CFLAGS="-fPIE -fPIC"
export LDFLAGS="-pie"
./configure \
--cpu="armv7-a" \
--enable-pic \
--disable-runtime-cpudetect \
--enable-pthreads \
--enable-hardcoded-tables \
--prefix=$PREFIX \
--disable-doc \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-doc \
--disable-network \
--enable-libmp3lame \
--enable-libx264 \
--enable-gpl \
--extra-ldflags="-latomic -L${NDK_SYSROOT}/usr/lib -L$TOOLCHAIN_PREFIX/arm-linux-androideabi/lib -L$TOOLCHAIN_PREFIX/lib -Llibmp3lame/lib -Lx264/android/armeabi-v7a/lib $LDFLAGS -v -lc -lm -ldl -llog -march=armv7-a"\
--extra-cflags="-ffast-math -funroll-loops -mfloat-abi=softfp -mfpu=vfpv3-d16 -Ilibmp3lame/include -Ix264/android/armeabi-v7a/include $CFLAGS -march=armv7-a -marm -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 -mthumb -D__thumb__ -fno-exceptions -fno-rtti -march=armv7-a -Wl,--fix-cortex-a8" \
--arch=arm\
--target-os=linux \
--enable-cross-compile \
--cross-prefix=$TOOLCHAIN_PREFIX/bin/arm-linux-androideabi- \
--nm=${NM} \
--cc=${CC} \
--cxx=${CXX} \
--ld=${LD} \
--ar=${AR} \
--as=${AS} \
--strip=${STRIP}
我使用此http://developer.samsung.com/android/technical-docs/Porting-and-using-LAME-MP3-on-Android-with-JNI构建了libmp3lame,并将其放置在libmp3lame / lib文件夹中。
我在config.log中收到这些未定义的错误。
/ home / git / ndks / stand_alone_toolchain_ndk18b / bin / arm-linux-androideabi-clang -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS = 64 -D_LARGEFILE_SOURCE -Dstrtod = avpriv_strtod -DPIC -fPIE -fPIC -ffast-math -funroll-loops -mfloat-abi = softfp -mfpu = vfpv3-d16 -Ilibmpxlami / / include -fPIE -fPIC -march = armv7-a -marm -mfloat-abi = softfp -mfpu = neon -mtune = cortex-a8 -mthumb -D__thumb__ -fno-exceptions -fno-rtti -march = armv7-a -Wl ,-fix-cortex-a8 -march = armv7-a -std = c11 -fomit-frame-pointer -fPIC -mthumb -c -o /tmp/ffconf.PT1BY4UI.o /tmp/ffconf.5z69vrhC.c clang70:警告: -Wl,-fix-cortex-a8:“链接器”输入未使用[-Wunused-command-line-argument] / home / git / ndks / stand_alone_toolchain_ndk18b / bin / arm-linux-androideabi-ld -pie -latomic -L / home / git / ndks / stand_alone_toolchain_ndk18b / sysroot / usr / lib -L / home / git / ndks / stand_alone_toolchain_ndk18b / arm-linux-androideabi / lib -L / home / git / ndks / stand_alone_toolchain_ndk18b / lib -Llibmp3lame / lib -Lx264 / android / armeabi-v7a / lib -pie -v -lc -lm -ldl -llog -march = armv7-a -o / tmp / ffconf .o9IsP7bS /tmp/ffconf.PT1BY4UI.o -lmp3lame -lm -lz libmp3lame / lib / libmp3lame.a(set_get.o)(。ARM.exidx.text.lame_set_num_samples + 0x0): 错误:未定义对'__aeabi_unwind_cpp_pr0'的引用 libmp3lame / lib / libmp3lame.a(set_get.o)(。ARM.exidx.text.lame_set_ogg + 0x0): 错误:未定义对'__aeabi_unwind_cpp_pr0'的引用 libmp3lame / lib / libmp3lame.a(set_get.o)(。ARM.exidx.text.lame_get_ogg + 0x0): 错误:未定义对'__aeabi_unwind_cpp_pr0'的引用 libmp3lame / lib / libmp3lame.a(set_get.o)(。ARM.exidx.text.lame_set_quality + 0x0): 错误:未定义对'__aeabi_unwind_cpp_pr0'的引用 D:/work_dir/battefield3/chimpoon/proj.android/app/jni /../../../../ lame / lame-3.100 /./ libmp3lame / set_get.c:2161: 错误:未定义对'__aeabi_uidiv'的引用 D:/work_dir/battefield3/chimpoon/proj.android/app/jni /../../../../ lame / lame-3.100 /./ libmp3lame / set_get.c:2165: 错误:对'__aeabi_uidivmod'的未定义引用 D:/work_dir/battefield3/chimpoon/proj.android/app/jni /../../../../ lame / lame-3.100 /./ libmp3lame / set_get.c:2170: 错误:对'__aeabi_uidiv'的未定义引用
请帮助我解决此问题。谢谢。