ffMPEG出现“inttypes.h未找到”错误

20
在Windows上使用Visual Studio 2010的ffMPEG构建时,我遇到了inttypes.h找不到的错误。
由于在互联网上搜索导致了错误的解决方案,我想在这里提供正确的解决方案,以便人们可以轻松找到。不久我将回答我的问题。
2个回答

44
解决方法是下载这个文件,并将inttypes.h文件放在Visual Studio可以找到它的位置,或者放在ffMPEG的common.h所在的文件夹中。如果选择后者,则必须将#include<inttypes.h>行更改为#include "inttypes.h"
我从这里找到了这个解决方法。

另一个我尝试过但没有起作用的解决方法是用以下内容替换#include<inttypes.h>:

typedef signed char  int8_t;
typedef signed short int16_t;
typedef signed int   int32_t;
typedef unsigned char  uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int   uint32_t;
typedef signed long long   int64_t;
typedef unsigned long long uint64_t;

这个解决方案来自这里

希望对你有所帮助。


在我的ffMPEG版本中,我还在pixdesc.h中包含了这个。此外,如果您只列出了外部包含文件夹,则应该是#include "libavutil/inttypes.d" - Chris

3
#ifndef HAS_INT_TYPES

#ifdef HAS_C99
  #include <stdint.h>
#endif

#endif

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接