ubuntu编译遇到的问题

一.ffmpeg链接不到库文件

cpp 复制代码
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" { }包含起来。

cpp 复制代码
extern "C"
{
#include <libavutil/frame.h>
#include <libavutil/mem.h>
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
}
相关推荐
FIT2CLOUD飞致云3 小时前
操作教程丨通过1Panel快速安装Zabbix,搭建企业级监控系统
运维·服务器·开源·zabbix·监控·1panel
幸存者letp3 小时前
Python 常用方法分类大全
linux·服务器·python
知识分享小能手3 小时前
Ubuntu入门学习教程,从入门到精通,Linux操作系统概述(1)
linux·学习·ubuntu
KnowFlow企业知识库3 小时前
KnowFlow v2.3.0 重磅发布:适配 RAGFlow v0.22.1 和 MinerU v2.6.5、新增支持多模态视频解析,让知识库"看见"更多
linux·github
悟空空心3 小时前
服务器长ping,traceroute
linux·服务器·网络·ssh·ip·ping++
Ghost Face...3 小时前
Docker实战:从安装到多容器编排指南
运维·docker·容器
此生只爱蛋4 小时前
【Linux】正/反向代理
linux·运维·服务器
qq_5470261794 小时前
Linux 基础
linux·运维·arm开发
zfj3214 小时前
sshd除了远程shell外还有哪些功能
linux·ssh·sftp·shell
废春啊4 小时前
前端工程化
运维·服务器·前端