When the Android APP uses the ffmpeg library compiled by NDK, the undefined reference to 'posix _ memalign 'error occurs. ndkffmpeg
When using the ffmpeg library compiled by NDK In the android program, the following error occurs:
Jni/libs/libavutil. a (mem. o): in function av_malloc: libavutil/mem. c: 95: error: undefined reference to 'posix _ memalign'
I checked it online and found that the android system didn't support posix at the beginning, and then added support for posix.
There are two main reasons for this problem:
1. The APP_PLATFORM specified during APP compilation is too low.
2. The NDK version used for APP compilation is too low.
Solution:
1. Check Application. mk in the jni directory to view APP_PLATFORM
This APP_PLATFORM must be a high (or equal to) version used when compiling ffmpeg with NDK)
Here I modify it from APP_PLATFORM: = android-10 to APP_PLATFORM: = android-17.
2. Check whether the NDK version for compiling ffmpeg is consistent with the NDK version used in the APP.
I upgraded from android-ndk-r9b version to android-ndk-r10e here
Command
2015.10.27
For more information, see http://www.cnblogs.com/42410/p/4915360.html. thank you!