When the Android APP uses the ffmpeg library compiled by NDK, the undefined reference to & #39; posix_memalign & #39; error occurs. ndkffmpeg

Source: Internet
Author: User

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!

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.