link error WMStub.lib解决

作者在使用DirectShow SDK进行视频处理时遇到编译错误,详细记录了LNK1181无法打开wmstub.lib文件的问题及解决过程。通过安装Windows Media Format SDK 7.1.1并正确配置路径后,成功解决了这一问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

           整天和视频打交道,从网上down了一段代码,修改了一下作为程序框架,没想到在VS2005环境下出现内存访问冲突的严重bug,而且原来的框架实现步进的功能还有缺陷,所以只好再看Directshow 的SDK。在SDK中的playwndasf是一个播放器的例子,没有想到出现如下错误:

******************************************************************************************

PlayWndASF.cpp
urllaunch.cpp
Linking...
LINK : fatal error LNK1181: cannot open input file "../../common/wmstub.lib"
Error executing link.exe.

PlayWndASF.exe - 1 error(s), 0 warning(s)

******************************************************************************************

从网上搜了一下和框架中的keyprovider.cpp中的说明:

NOTE: To link and run this sample, you must install the Windows Media Format SDK 7.1.1.
  After downloading the Format SDK, you can extract a public version of the
  WMStub.LIB library, which should be copied to the Samples/C++/DirectShow/Common folder.
  This library is necessary for enabling Windows Media content.
  Without this library in the Common folder, the link will fail with:
      LNK1104: cannot open file '../../common/wmstub.lib'
  If you remove the WMStub.lib from the project's linker settings, the linker
  will fail with this unresolved reference:
      WMCreateCertificate

看来需要wmstub.lib库支持,还好这个库从网上可以下到,需要注册的:

http://bbs.lmtw.com/dispbbs.asp?BoardID=102&ID=120939&replyID=7912&skin=1

按照说明拷贝到:  /DXSDK/Samples/C++/DirectShow/Common/ 下面重新编译还存在上述错误,只好重新装了一次Directshow,一切OK。

其中wmstub.lib下载在陆其明的blog里面有说明,但是我没有找到该文件:

http://jemylu.spaces.live.com/blog/cns!E1C9F572B6A2D19!377.entry

此外微软论坛上有高人的指点,但是我没有搞定:

https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=284729&SiteID=1

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值