当前位置: 代码迷 >> 综合 >> C++/vs2019使用ffmpeg报错:#error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
  详细解决方案

C++/vs2019使用ffmpeg报错:#error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS

热度:76   发布时间:2023-12-12 17:03:43.0

C++/vs2019使用ffmpeg报错:#error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS,解决办法-在common.h中添加宏定义,如下。

#ifndef AVUTIL_COMMON_H
#define AVUTIL_COMMON_H//添加宏定义
#ifdef __cplusplus
#define __STDC_CONSTANT_MACROS
#ifdef _STDINT_H
#undef STDINT_H
#endif
#include "stdint.h"
#endif // __cplusplus#ifndef INT_64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif // INT_64_C#if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS) && !defined(UINT64_C)
#error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
#endif

  相关解决方案