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
然后再重新编译,通常可以解决该问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值