我想使用 FFmpeg 在 android 上解码 mp3 和 acc,我使用 android-ndk-r7 和最新的 cygwin。
我写了一个shell config.sh,内容是:
TMPDIR=/cygdrive/c/temp
PREBUILT=/cygdrive/c/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows
PLATFORM=/cygdrive/c/android-ndk-r7/platforms/android-8/arch-arm
./configure --target-os=linux --arch=arm --enable-version3 --enable-gpl --enable-nonfree --disable-stripping --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-ffprobe --disable-encoders --disable-muxers --disable-devices --disable-protocols --enable-protocol=file --enable-avfilter --disable-network --disable-mpegaudio-hp --disable-avdevice --enable-cross-compile --cc=$PREBUILT/bin/arm-linux-androideabi-gcc --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- --nm=$PREBUILT/bin/arm-linux-androideabi-nm --extra-cflags="-fPIC -DANDROID" --disable-asm --enable-neon --enable-armv5te --extra-ldflags="-Wl,-T,$PREBUILT/arm-eabi/lib/ldscripts/armelf_linux_eabi.x -Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/crtbegin.o $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/crtend.o -lc -lm -ldl"
我打开cmd,做bash打开cygwin shell,然后做./config,出现问题:“/cygdrive/c/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/ bin/arm-linux-androideabi-gcc 无法创建可执行文件..."
config.log 是:
check_ld
check_cc
BEGIN /cygdrive/c/temp/ffconf.SFJc3t92.c
1 int main(void){ return 0; }
END /cygdrive/c/temp/ffconf.SFJc3t92.c
gcc -fPIC -DANDROID -std=c99 -c -o /cygdrive/c/temp/ffconf.YKRv5TSp.o /cygdrive/c/temp/ffconf.SFJc3t92.c
/cygdrive/c/temp/ffconf.SFJc3t92.c:1:0: warning: -fPIC ignored for target (all code is position independent)
gcc -Wl,-rpath-link=/cygdrive/c/android-ndk-r7/platforms/android-4/arch-arm/usr/lib -L/cygdrive/c/android-ndk-r7/platforms/android-4/arch-arm/usr/lib -nostdlib /cygdrive/c/android-ndk-r7/platforms/android-4/arch-arm/usr/lib/crtbegin_static.o /cygdrive/c/android-ndk-r7/platforms/android-4/arch-arm/usr/lib/crtend_android.o -lc -lm -ldl -o /cygdrive/c/temp/ffconf.Yf1Ftjmo /cygdrive/c/temp/ffconf.YKRv5TSp.o
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: /cygdrive/c/android-ndk-r7/platforms/android-4/arch-arm/usr/lib/crtbegin_static.o: Relocations in generic ELF (EM: 40)
/cygdrive/c/android-ndk-r7/platforms/android-4/arch-arm/usr/lib/crtbegin_static.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
C compiler test failed.
不知道是怎么回事,有大神知道是怎么回事,谢谢。