error C3861: 'UINT64_C': identifier not found
#ifndef INT64_C
#define INT64_C
#define UINT64_C
#endif
Cannot open include file: 'inttypes.h': No such file or director解决办法
1、找到include目录中的ffmpeg\common.h
2、在“#define COMMON_H”之后加入如下代码,同时删除“#include <inttypes.h>” 然后保存:
#if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
# define CONFIG_WIN32
#endif
#if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(EMULATE_INTTYPES)
# define EMULATE_INTTYPES
#endif
#ifndef EMULATE_INTTYPES
# include <inttypes.h>
#else
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;
# ifdef CONFIG_WIN32
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
# else
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
# endif
#endif
出现Cannot open include file: 'stdint.h': No such file or directory
在出现 #include <stdint.h>的地方注掉即可
出现 'class' : missing tag name
将void show_help_children(const AVClass *class, int flags);
改成void show_help_children(const AVClass *avclass, int flags);
SHOW_MODE_NONE未定义
将enum ShowMode {
SHOW_MODE_NONE = -1, SHOW_MODE_VIDEO = 0, SHOW_MODE_WAVES, SHOW_MODE_RDFT, SHOW_MODE_NB
}show;
改成enum ShowMode {
SHOW_MODE_NONE = -1, SHOW_MODE_VIDEO = 0, SHOW_MODE_WAVES, SHOW_MODE_RDFT, SHOW_MODE_NB
};然后放到VideoState外面去。
VideoState里面的改成 enum ShowMode show_mode;
出现error C2668: 'sqrt' : ambiguous call to overloaded function
这涉及到C++的函数重载的概念。
比如当编译器看到sqrt(3)的时候,它会试图去找一个sqrt(int)的函数,但是找不到。
于是退而求其次,找一个可以从int转换过去的sqrt,有两种情况:sqrt(long double),sqrt(float)。编译器认为把int转换成long double或者float都很合理。
解决办法:(1)sqrt(3.0) (2)sqrtf(3)
将 double w = 1 / sqrt(nb_freq);
改成double w = 1 / sqrt((double)nb_freq);
出现 'usleep': identifier not found
这里因为VC中没有usleep,usleep是微妙级别的,所以需要把代码改为
usleep(is->audio_st && is->show_audio ? rdftspeed*1000 : 5000);
to
Sleep (is->audio_st && is->show_audio ? rdftspeed*1 : 5);
出现missing ')' before identifier 'PRId64'
在头文件添加如此定义
#define INT64_C(val) val##i64
#define _64BITARG_ "I64"
#define PRId64 _64BITARG_"d"
#define PRIu64 _64BITARG_"u"
cannot convert from 'int' to 'PixelFormat'
将 vp->pix_fmt = is->out_video_filter->inputs[0]->format;
改成vp->pix_fmt = (PixelFormat)is->out_video_filter->inputs[0]->format;
不能直接将Int赋值给PixelFormat要进行强制转换
出现av_opt_ptr未定义
引入#include "libavutil/opt.h"
'snprintf': identifier not found
添加
#if _MSC_VER
#define snprintf _snprintf
#endif
(shijieflasher) |