c++ - 将 ffmpeg 库与 Qt 框架一起使用会导致错误
问题描述
当我包括:
extern "C" {
#include <libavcodec/avcodec.h>
}
我收到错误消息:
未定义对 QVideoSurfaceFormat::QVideoSurfaceFormat(QSize const&, QVideoFrame::AVPixelFormat, QAbstractVideoBuffer::HandleType) 的引用
没有包含 - 构建成功。
我的猜测包括带来了一些打破 QVideoSurfaceFormat 定义的定义。
有人遇到过类似的问题吗?
解决方案
#define __STDC_CONSTANT_MACROS // to fix #include <stdint.h> issue
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
}
在阅读了网络中的 stdint.h 和相关主题后,找到了适合我的解决方案:
#define __STDC_CONSTANT_MACROS
推荐阅读
- laravel-livewire - 在 te7a-houdini/laravel-trix 中单击样式按钮时,不应用更改
- amazon-web-services - 我应该如何配置 Terraform 远程状态 S3 存储桶和状态锁定 DynamoDB 表?
- powershell - 从 csv 导入 if 和 else 语句不起作用时,Powershell Windows Defender 是启用了防病毒的脚本
- azure-active-directory - 使用 az cli 为外部/外部组分配角色?
- powershell - 在脚本中使用引号内的变量来映射网络驱动器
- flutter - Flutter - 退出应用程序时释放后台服务
- flutter - Flutter 无法访问数据,因为它可能为 null
- angular - RxJS cacheError((error:any) 不能接受任何对象类型作为参数
- angular - 我正在尝试将数据库结果分组为角度
- excel - 如何在PowerPoint中制作带有2级标题的条形图?