VC下ffmpeg例程調試報錯處理
tools/options/directories/include files 添加ffmpeg頭文件所在路徑
tools/options/directories/library files 添加ffmpeg庫路徑
project/settings/link/object/library modules 添加所用的ffmpeg庫
二
二二
二、
、、
、報錯解決
報錯解決報錯解決
報錯解決
1、解決: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 */
保存後再編譯
2、解決error C2054: expected '(' to follow 'inline'
不用改代碼,直接改project->[setting]->[c/c++]->Preprocessor definitions:編輯框裏輸入
inline=__inline即可
3、解決error C2010: '.' : unexpected in macro formal parameter list
直接注釋掉相應行 ,換版本
4
、解決
VC
不包含
stdint.h
頭文件問題
stdint.h是C99的標準,主要用於統一跨平台數據定義。MSVC中不帶有這個頭文件,
直到VS2010。在之前的版本裏麵,我們可以:
(1)下載這個頭文件
download a MS version of this header from:
https://msinttypes.googlecode.com/svn/trunk/stdint.h
A portable one can be found here:
https://www.azillionmonkeys.com/qed/pstdint.h
(2)將頭文件放到(以VS2008為例):
C:\Program Files\Microsoft Visual Studio 9.0\VC\include
最後更新:2017-04-03 16:49:00