在Windows上使用Visual Studio 2010的ffMPEG构建时,我遇到了inttypes.h找不到的错误。
由于在互联网上搜索导致了错误的解决方案,我想在这里提供正确的解决方案,以便人们可以轻松找到。不久我将回答我的问题。
由于在互联网上搜索导致了错误的解决方案,我想在这里提供正确的解决方案,以便人们可以轻松找到。不久我将回答我的问题。
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;
这个解决方案来自这里。
希望对你有所帮助。
#ifndef HAS_INT_TYPES
#ifdef HAS_C99
#include <stdint.h>
#endif
#endif
#include "libavutil/inttypes.d"
。 - Chris