在QT中使用FFmpeg库的部分报错问题
win32: LIBS += -L$$PWD/../ffmpeg-win32-dev/lib/ -lavutil
win32: LIBS += -L$$PWD/../ffmpeg-win32-dev/lib/ -lavformat
win32: LIBS += -L$$PWD/../ffmpeg-win32-dev/lib/ -lswresample
win32: LIBS += -L$$PWD/../ffmpeg-win32-dev/lib/ -lswscale
INCLUDEPATH += $$PWD/../ffmpeg-win32-dev/include
DEPENDPATH += $$PWD/../ffmpeg-win32-dev/include
#include <libavutil/channel_layout.h> //用户音频声道布局操作 #include <libavutil/opt.h> //设置操作选项操作
#include <libavutil/mathematics.h> //用于数学相关操作
#include <libavutil/timestamp.h> //用于时间戳操作
#include <libavformat/avformat.h> //用于封装与解封装操作
#include <libswscale/swscale.h> //用于缩放、转换颜色格式操作
#include <libswresample/swresample.h> //用于进行音频采样率操作
使用遇到错误:D:\ffmpeg\dev\include\libavutil\common.h:210: error: ‘UINT64_C’ was not declared in this scope
if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF);
解决方法:
在common.h文件中加入
#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif
使用遇到错误D:\ffmpeg\dev\include\libavutil\common.h:32: error: #error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
#error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
解决办法:
记住要加到error missing -D__STDC_CONSTANT_MACROS 的前面不然还是找不到
#if defined __cplusplus
#define __STDC_CONSTANT_MACROS
#endif
注:以上类似#error missing -D__STDC_CONSTANT_MACROS 的错误都可以这样处理。
建议都在common.h文件里声明,如下
/////新增////////////
#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif #if defined __cplusplus
#define __STDC_CONSTANT_MACROS //common.h中的错误
#define __STDC_FORMAT_MACROS //timestamp.h中的错误
#endif /////////////////////
参考:https://blog.csdn.net/qq_36088602/article/details/77885023
undefined reference to `av_register_all' 问题解决
解决方法:
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
引入头文件因为实在cpp的环境下引入的,需要
extern "C"
{
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
}
切记 exterm后面一定要跟{}。
这样写
extern "C"
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
是没有用的 这种是错误的。一定要带{},否则还是回报同样的错误。
参考:https://blog.csdn.net/qq_18144521/article/details/79608355
在QT中使用FFmpeg库的部分报错问题的更多相关文章
- Qt编译目录下exe文件执行报错问题的解决办法
使用Qt5.9.3+vs2017环境,编译项目生成Debug目录,运行其中的exe文件,出现以下错误(qt creator调试状态下或出安装包后是可以运行的): 经过查阅资料,发现是我重新配置Qt开发 ...
- 引用AForge.video.ffmpeg,打开时会报错:找不到指定的模块,需要把发行包第三方文件externals\ffmpeg\bin里的dll文件拷到windows的system32文件夹下。
引用AForge.video.ffmpeg,打开时会报错:找不到指定的模块,需要把发行包第三方文件externals\ffmpeg\bin里的dll文件拷到windows的system32文件夹下. ...
- IntelliJ IDEA中Mapper接口通过@Autowired注入报错的正确解决方式
转载请注明来源:四个空格 » IntelliJ IDEA中Mapper接口通过@Autowired注入报错的正确解决方式: 环境 ideaIU-2018.3.4.win: 错误提示: Could no ...
- postgresql 删除库的时候报错database "temp_test_yang" is being accessed by other users
删除库的时候报错 ERROR: database "temp_test_yang" is being accessed by other usersDETAIL: There ar ...
- 【转载】访问IIS中网站出现 403.14 - Forbidden报错信息
将网站发布后部署到IIS后,配置完应用程序池以及相关设置项后,在浏览器中访问设置好的网站,出现403.14 - Forbidden的错误信息,从错误信息的提示来看,应该是IIS服务器此网站目录的内容被 ...
- 【maven】【IDEA】idea中使用maven编译项目,报错java: 错误: 找不到符号 【2】
=================================================================================== idea中使用maven编译项目 ...
- eclipse 中离线安装activiti插件,报错“An error occurred while collecting items to be installed session context was:(...”
eclipse 中离线安装activiti插件,报错“An error occurred while collecting items to be installed session context ...
- ubuntu16.04安装库、插件报错:
安装一些插件.库,遇到报错 Could not fetch URL https://pypi.org/simple/pytest-pycodestyle/: There was a problem c ...
- QT中使用Glut库
用Qt中的QGLWidget窗体类中是不包括glut工具库的,难怪在myGLWidget(在我的程序中是QGLWidget的派生类)中绘制实心球体是说“glutSolidSphere”: 找不到标识符 ...
随机推荐
- GBT22239-2008-等保1.0三级要求
第三级基本要求 7.1 技术要求 7.1.1 物理安全 7.1.1.1 物理位置的选择(G3) 本项要求包括: a) 机房和办公场地应选择在具有防震.防风和防雨等能力的建筑内: b) 机房场地 ...
- python:html元素解析
说明 主要是总结我通过python实现html解析的一个初步的思路和记录实现基础html解析的代码.本解析方式仅仅 只是实现了html按元素解析的功能,具体元素的分类获取还得需要再进行进一步的优化. ...
- docker 简单介绍与安装
主机虚拟化(vmware,visual box等) type-Ⅰ type=Ⅱ 主机虚拟化是隔离最彻底的,但是由于多隔了一个虚拟的操作系统,性能会慢一些. 容器虚拟化(docker等) 隔离没有主机虚 ...
- emacs 帮助相关命令
emacs 帮助相关命令 如下表: No. 键盘操作 键盘操作对应的函数 回答的问题 01 ctrl-h c describe-key-briefly 这个按键组合将运行哪个函数 02 ctrl-h ...
- nginx是怎么处理http请求的
nginx是怎么处理http请求的 参考:How nginx processes a request nginx first decides which server should process t ...
- C学习笔记(2)---各类函数
1.函数(function)声明定义: 见例子,不复述:https://www.runoob.com/cprogramming/c-functions.html 2. 函数参数(Parameters“ ...
- vue项目关闭eslint校验
[前言] eslint是一个JavaScript的校验插件,通常用来校验语法或代码的书写风格.这篇文章主要介绍了vue项目关闭eslint校验,需要的朋友可以参考下 [主体] 简介eslint esl ...
- pytroch 权重初始化和加载词向量的方法
1.几种不同的初始化方法 import torch.nn as nn embedding = torch.Tensor(3, 5) #如下6种初始化方法 #正态分布 nn.init.normal_(e ...
- [C1W3] Neural Networks and Deep Learning - Shallow neural networks
第三周:浅层神经网络(Shallow neural networks) 神经网络概述(Neural Network Overview) 本周你将学习如何实现一个神经网络.在我们深入学习具体技术之前,我 ...
- 牛客OI周赛13-提高组-0还是1-(dp+位运算)
https://ac.nowcoder.com/acm/contest/2970/A 给出长度为n的一连串位运算符号,用n+1个0或1使运算插入最后得到1,求01序列有多少种可能. dp[i][j]表 ...