DirectShow开发中常见错误

1.0 未申明的错误解决办法

头文件顺序不对

在项目中包含(1.选择任意项目2.切换到属性管理器3.点击Debug/Release里的Microsoft.Cpp.Win32.user)

注意包含顺序

C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses

C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\common

C:\Program Files\Microsoft SDKs\Windows\v7.1\Include

以及lib:

C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib

C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\Debug

C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\Release


2.0  error C2065: “m_pString”: 未声明的标识符请添加如下代码

#include

#define PTCHAR (TCHAR *)

3.0  error C2039: 'SetDefaultDllDirectories'错误解决办法

预定义中增加一项定义  _USING_V110_SDK71_

4.0  错误 C2373 “_DeleteMediaTypes”: 重定义;不同的类型修饰符

错误 C2373 “_FreeMediaType”: 重定义;不同的类型修饰符

注释  mtype.h 文件中

//void WINAPI DeleteMediaType(__inout_opt AM_MEDIA_TYPE *pmt);

AM_MEDIA_TYPE * WINAPI CreateMediaType(AM_MEDIA_TYPE const *pSrc);

HRESULT WINAPI CopyMediaType(__out AM_MEDIA_TYPE *pmtTarget, const AM_MEDIA_TYPE *pmtSource);

//void WINAPI FreeMediaType(__inout AM_MEDIA_TYPE& mt);

你可能感兴趣的:(DirectShow开发中常见错误)