error: undefined reference to 'av_register_all()'

cygwin下ndk编译工程中使用ffmpeg时出现的错误:“error: undefined reference to 'av_register_all()'”

使用ffmpeg的源文件是  *.cpp 而且在已经引入了ffmpeg的相应的头文件。

所以解决方法:

extern "C"
{
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
}

------------------------------

即使用 extern "C" 限定 引入的ffmpeg的头文件。

参考:http://bbs.csdn.net/topics/390203566

原文地址:https://www.cnblogs.com/wainiwann/p/4387245.html