在Windows中使用Visual Studio 2010构建ffMPEG时,我遇到了inttypes.h未找到错误。
由于在互联网上搜索导致我找到错误的解决方案,我想我会在这里提出正确的解决方案,以便人们可以轻松找到它。很快就会回答我自己的问题。
答案 0 :(得分:43)
解决方案是下载this file并将inttypes.h
文件放在Visual Studio可以找到的位置,或放在ffMPEG的common.h
所在的文件夹中。如果您选择后者,则必须将#include<inttypes.h>
行更改为#include "inttypes.h"
从here得到了这个解决方案。
另一个对我不起作用的解决方案是将#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;
该解决方案来自here。
希望这会有所帮助。
答案 1 :(得分:2)
#ifndef HAS_INT_TYPES
#ifdef HAS_C99
#include <stdint.h>
#endif
#endif