[FFmpeg-user] Cross-compile ffmpeg with android ndk and libspeex fails

Marcin Griszbacher marcin.griszbacher at gmail.com
Tue Sep 20 09:16:04 EEST 2016

> On Sep 19, 2016, at 9:29 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> 2016-09-19 19:37 GMT+02:00 Marcin Griszbacher <marcin.griszbacher at gmail.com>:
>> Hello. I need to build ffmpeg as library for android. I use slightly modified
>> bambuser script
> Such scripts are not supported here, we only support our configure script;-(

I said that I am using it since it’s the only working solution I found on ffmpeg site for Android platform :) but if that’s the case, I will post what does my script give as a result (I will cut out --enable encoders and decoders so it’s more clear). Adding --pkg-config=true and C/LDFLAGS didn’t help at all, unless I do something wrong.

--target-os=linux --cross-prefix=arm-linux-androideabi- --arch=arm --sysroot=/Users/mgriszbacher/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-arm --enable-shared --disable-symver --enable-small --disable-everything --enable-libspeex --pkg-config=true --prefix=../build/ffmpeg/armeabi --extra-cflags= -I/usr/local/include/ --extra-ldflags= -L/usr/local/lib/ -Ispeex

I am 100% sure that I can find Speex in /usr/local/include/speex/{headers} and /usr/local/lib/libspeex.*, so according to logic flags should resolve this; however it’s not the case this time, as I still get “speex not found using pkg-config” error. Error in the log changed to this:

check_pkg_config speex speex/speex.h speex_decoder_init -lspeex
true --exists --print-errors speex
check_func_headers speex/speex.h speex_decoder_init -lspeex
check_ld cc -lspeex
BEGIN /tmp/ffconf.DxnTuhmx.c
    1	#include <speex/speex.h>
    2	long check_speex_decoder_init(void) { return (long) speex_decoder_init; }
    3	int main(void) { return 0; }
END /tmp/ffconf.DxnTuhmx.c
arm-linux-androideabi-gcc --sysroot=/Users/mgriszbacher/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-arm -isysroot /Users/mgriszbacher/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-arm -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -I/usr/local/include/ -march=armv5te -std=c99 -fomit-frame-pointer -fPIC -marm -pthread -c -o /tmp/ffconf.n78Sf87X.o /tmp/ffconf.DxnTuhmx.c
arm-linux-androideabi-gcc -L/usr/local/lib/ -Ispeex --sysroot=/Users/mgriszbacher/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-arm -isysroot /Users/mgriszbacher/Library/Android/sdk/ndk-bundle/platforms/android-16/arch-arm -march=armv5te -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/ffconf.VU8JDtMD /tmp/ffconf.n78Sf87X.o -lspeex -lm -lz -pthread
/Users/mgriszbacher/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: speex: no archive symbol table (run ranlib)
/tmp/ffconf.n78Sf87X.o:ffconf.DxnTuhmx.c:function check_speex_decoder_init: error: undefined reference to 'speex_decoder_init'
collect2: error: ld returned 1 exit status
ERROR: speex not found using pkg-config

Any further idea to fix this?

More information about the ffmpeg-user mailing list