ffmpeg(1)之libavutil/common.h:30:2: error: missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
说明
- 编译环境: mac osx 10.14 + cmake + clang++
- 写了一个简单c++的范例调用ffmpeg函数完成音频采集
出错提示
[build] /usr/local/ffmpeg/include/libavutil/common.h:30:2: error: missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
[build] #error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
[build] ^
[build] 1 error generated.
[build] make[2]: *** [CMakeFiles/ffmpeg_demo.dir/example/main.cc.o] Error 1
[build] make[1]: *** [CMakeFiles/ffmpeg_demo.dir/all] Error 2
解决办法
- clang 提示的很明显: 需 定义宏 __STDC_CONSTANT_MACROS
- 引文ffmpeg库中的函数是C语言,而我是用的c++调用。
- __STDC_CONSTANT_MACROS 一定要放在 include 之前
#define __STDC_CONSTANT_MACROS
extern "C"{
#include "/usr/local/ffmpeg/include/libavutil/log.h"
#include <libavformat/avformat.h>
#include <libavdevice/avdevice.h>
}
ffmpeg(1)之libavutil/common.h:30:2: error: missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS的更多相关文章
- 调用ffmpeg库编译时出现common.h:175:47: error: 'UINT64_C' was not declared in this scope
解决办法 出现错误:jni/ffmpeg/libavutil/common.h:175:47: error: 'UINT64_C' was not declared in this scope 解决: ...
- 用g++ 编译 ffmpeg 编译出现 error: 'UINT64_C' was not declared in this scope 或 missing -D__STDC_CONSTANT_MACROS
在 libavutil/common.h 下 添加如下,即可解决 #ifdef __cplusplus#define __STDC_CONSTANT_MACROS#ifdef _STDINT_H#un ...
- ffmpeg解码RTSP/TCP视频流H.264(QT界面显示视频画面)
源码下载地址: http://download.csdn.net/detail/liukang325/9489952 我用的ffmpeg版本为 ffmpeg-2.1.8.tar.bz2 版本低了恐怕有 ...
- libavcodec/dxva2.h:40:5: error: unknown type name 'IDirectXVideoDecoder'
gcc 4.9.2 编译 ffmpeg-git-1aeb88b 是出现如下错误 > FFmpeg fails to make with: > > CC libavcodec/dxva ...
- redis make时 提示 zmalloc.h:50:31: error: jemalloc/jemalloc.h:
redis安装需要环境必备 gcc 但是若未先安装好gcc,make失败后再次 make 会提示如下错误 zmalloc.h:50:31: error: jemalloc/jemalloc.h: 这时 ...
- error CS0007: Unexpected common language runtime initialization error -- '没有注册类别 '
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]"Inst ...
- afx.h(78): fatal error C1083: 无法打开包括文件: “new.h”: No such file or directory
vs2015新建mfc工程,编译错误: D:\program files (x86)\microsoft visual studio 14.0\vc\atlmfc\include\afx.h(78): ...
- abp Cannot access a disposed object. A common cause of this error is disposing
框架:abp 异常信息: An unhandled exception was thrown by the application.System.ObjectDisposedException: Ca ...
- ../include/squid_md5.h:27:2: error: #error Cannot find OpenSSL MD5 headers【squid安装中】
../include/squid_md5.h:27:2: error: #error Cannot find OpenSSL MD5 headers yum install -y openssl* w ...
随机推荐
- Harbour.Space Scholarship Contest 2021-2022 题解
多好的上分机会啊,要是换个时间(指改在 NOI 之后)我说不定就能上 2500 了(做白日梦 ing) A 签到题不多说,显然只有末尾为 \(9\) 的数是 interesting 的,因此答案就是 ...
- 用 AppImage文件创建快捷图标和软连接
背景 AppImage是一种在Linux系统中用于分发便携式软件而不需要超级用户权限来安装它们的格式.[1] 它还试图允许Linux的上游开发者来分发他们的程序而不用考虑不同Linux发行版间的区别. ...
- 【基因组注释】ncRNA注释
目录 1. ncRNA 2. 软件 tRNA注释 rRNA注释 其他ncRNA注释 3. 注释 tRNA rRNA snRNA.miRNA等 4. snRNA.miRNA等结果的统计 1. ncRNA ...
- go定义接口以及类怎么使用接口
go定义接口以及类怎么使用接口 多态是指代码可以根据类型的具体实现采取不同行为的能力.如果一个类型实现了某个接口,所有使用这个接口的地方,都可以支持这种类型的值. 接口是用来定义行为的类型.这些被定义 ...
- urllib的基本使用介绍
1. urllib中urlopen的基本使用介绍 1 ### urllib中urlopen的基本使用介绍 2 3 ## urlopen的基本用法(GET请求) 4 import urllib.requ ...
- 5分钟6步强制删除kubernetes NameSpace小技巧
在使用kubernetes过程中,我们经常会遇到无法删除NameSpace的情况,但是如果一一去删除NameSpace中资源比较麻烦.下面我们给大家介绍强制删除NameSpace的方法. 一.查看已存 ...
- day11 序列化组件、批量出入、自定义分页器
day11 序列化组件.批量出入.自定义分页器 今日内容详细 ajax实现删除二次提醒(普通版本) ajax结合第三方插件sweetalert实现二次提醒(样式好看些) ajax如何发送文件数据 aj ...
- 【STM32】使用SDIO进行SD卡读写,包含文件管理FatFs(四)-介绍库函数,获取一些SD卡的信息
其他链接 [STM32]使用SDIO进行SD卡读写,包含文件管理FatFs(一)-初步认识SD卡 [STM32]使用SDIO进行SD卡读写,包含文件管理FatFs(二)-了解SD总线,命令的相关介绍 ...
- Kotlin 学习(2)
属性和字段 1.声明属性 Kotlin中可以使用var关键字声明可变属性,或者用val关键字声明只读属性,属性的类型在后面,变量名在前面,中间加冒号和空格. public class Address ...
- 字符串属性转变List属性存入数据库
项目中有系统IP字段,现将string转List存入数据库,每个功能块持久层实现方法不一样(分为jpa和mp) jpa: @Convert(converter = JpaConverterListJs ...