1

I have successfully compiled ffmpeg as a static library for my project with android-platform 19 which specified in Application.xml as below:

APP_PLATFORM := android-19

I test my project on a device(4.4),it runs well. But it will crash on 4.0 devices.

So I would like to changed the APP_PLATFORM to a lower version like:

APP_PLATFORM := android-17

But the ide comes out an error like this.

libavcodec/ffv1enc.c:631: error: undefined reference to 'log2'

And when I changed it to a more lower version:

APP_PLATFORM := android-8

More errors occured:

libavcodec/ffv1enc.c:631: error: undefined reference to 'log2'
libavutil/mem.c:94: error: undefined reference to 'posix_memalign'

I know the log2 reference is undefined because of missing libm, but as far as I see Android will automatic link to libm when building.http://mobilepearls.com/labs/native-android-api/ndk/docs/STABLE-APIS.html

So how can I keep compatibility when compiling ffmpeg in order to run my project well on lower version devices.

Jiakang Zhang
  • 869
  • 1
  • 7
  • 6

1 Answers1

2

I have fixed this problem by reComplie ffmpeg with a lower version ndk platform tools.

Then keep the same version in Android.mk.

Those errors didn't occur any more.

Jiakang Zhang
  • 869
  • 1
  • 7
  • 6