vc 编译ffmpeg问题集

解决:Cannot open include file: 'inttypes.h'

更新ffmpeg之后,有时编译应用ffmpeg库的工程会发现提示: Cannot open include file: 'inttypes.h': No such file or directory 的出错信息,可通过如下方法解决:
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 /* other OS */
        typedef signed long long   int64_t;
        typedef unsigned long long uint64_t;
#   endif /* other OS */
#endif /* EMULATE_INTTYPES */

解决 error C3861: 'UINT64_C': identifier not found

#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif

 

ffmpeg.exe初始化出错

如果你编译的ffmpeg.exe运行时,出现“应用程序正常初始化(0xc0000005)失败”(The application failed to initialize properly (0x0000005). Click on OK to terminate the application),而且是shared link方式,通常的原因是GCC的版本问题,更换一个GCC的版本应该可以解决该问题。

下载一份gcc-core-4.2.1-sjlj-2.tar.gz,然后解压缩
进入mingw\bin目录,通常是:C:\msys\mingw\bin\ 然后重命名下述文件:
c++-sjlj.exe to c++.exe
cpp-sjlj.exe to cpp.exe
g++-sjlj.exe to g++.exe
gcc-sjlj.exe to gcc.exe
然后再重新编译,通常可以解决该问题。
原文地址:https://www.cnblogs.com/foxhengxing/p/1895052.html