使用DirectShow需要添加的动态库

目录

使用DirectShow需要添加的动态库

编译一段使用DirectShow代码(包含 DirectX 9.0 SDK (summer 2004) 中的头文件qedit.h),出现如下的链接错误

error LNK2001: 无法解析的外部符号 _IID_ISampleGrabberCB
error LNK2001: 无法解析的外部符号 _IID_IMediaControl
error LNK2001: 无法解析的外部符号 _TIME_FORMAT_FRAME
error LNK2001: 无法解析的外部符号 _TIME_FORMAT_MEDIA_TIME
error LNK2001: 无法解析的外部符号 _IID_IMediaSeeking
error LNK2001: 无法解析的外部符号 _CLSID_NullRenderer
error LNK2001: 无法解析的外部符号 _IID_IBaseFilter
error LNK2001: 无法解析的外部符号 _IID_ISampleGrabber
error LNK2001: 无法解析的外部符号 _CLSID_SampleGrabber
error LNK2001: 无法解析的外部符号 _FORMAT_VideoInfo
error LNK2001: 无法解析的外部符号 _MEDIASUBTYPE_RGB24
error LNK2001: 无法解析的外部符号 _MEDIATYPE_Video
error LNK2001: 无法解析的外部符号 _MEDIASUBTYPE_IEEE_FLOAT
error LNK2001: 无法解析的外部符号 _FORMAT_WaveFormatEx
error LNK2001: 无法解析的外部符号 _MEDIASUBTYPE_PCM
error LNK2001: 无法解析的外部符号 _MEDIATYPE_Audio
error LNK2001: 无法解析的外部符号 _CLSID_FilterGraph
error LNK2001: 无法解析的外部符号 _IID_IGraphBuilder
error LNK2001: 无法解析的外部符号 _IID_IMediaFilter
error LNK2001: 无法解析的外部符号 _IID_IMediaEven

一开始以为是程序调用设置的问题,找了两个多小时,最后终于找到原因。就是error LNK2001之类问题最常见的原因:没有设置相关的链接库。这些函数都属于一个库文件: strmiids.lib ,在DirectX SDK目录中lib文件中。

在 程序属性->链接器->输入->附加依赖项 中加入即可解决问题。