ubuntu编译遇到的问题
一.ffmpeg链接不到库文件
undefined reference to `avcodec_register_all'
undefined reference to `avcodec_register_all'
undefined reference to `av_opt_set_defaults'
undefined reference to `av_opt_set_defaults'
undefined reference to `av_parse_video_frame_rate'
undefined reference to `av_parse_video_frame_size'
undefined reference to `avcodec_string'
undefined reference to `avcodec_alloc_context'
undefined reference to `av_fast_realloc'
undefined reference to `av_get_bits_per_sample'
undefined reference to `av_parser_close'
undefined reference to `av_parser_close'
问题分析:函数实现在.c文件中,需要将相关的头文件使用extern "C" { }包含起来。
extern "C"
{
#include <libavutil/frame.h>
#include <libavutil/mem.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
}
原文地址:https://blog.csdn.net/Ricardo_XIAOHAO/article/details/144725179
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!