未解决的初学者外部... [英] Unresolved externals for a beginner...
本文介绍了未解决的初学者外部...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是c ++的新手,所以请耐心等待。
我是构建一些使用包含头文件的d ++(dshow.h)但是在链接时我在IID上使用未解析的外部和我使用的CLSID。
我尝试过:
我可以通过查看包含的文件并创建我自己的guids.h文件来作弊,例如:
Hi,
I am new to c++ so please bear with me.
I am building some c++ that uses included headers (dshow.h) but when linking I get unresolved externals on IID and CLSID I use.
What I have tried:
I can cheat by looking into the included files and creating my own guids.h file eg:
extern "C"
{
extern const IID IID_IDvdGraphBuilder =
{ 0xFCC152B6, 0xF372, 0x11d0,
{ 0x8E, 0x00, 0x00, 0xC0, 0x4F, 0xD7, 0xC0, 0x8B } };
extern const CLSID CLSID_DvdGraphBuilder =
{ 0xFCC152B7, 0xF372, 0x11d0,
{ 0x8E, 0x00, 0x00, 0xC0, 0x4F, 0xD7, 0xC0, 0x8B } };
}
这样可行,但从长远来看这不好,我错过了什么?
This works but this is not good for the long term, what am I missing?
推荐答案
您正在开发一个不容易的COM项目。花一些时间从好的方面学习 COM教程。
定义这些值是正确的,但要确保它们是唯一的,因为它们是用于创建这些值的标识符类。
永远记住:如果发生错误,请查看第一个非空返回码(HRESULT)。
就像纸牌屋一样,很多东西都可能出错; - )
You are working on a COM project which isnt easy at all. Take some time and learn from a good COM tutorials.
It is correct to define these values, but be sure that they are unique because the are the identifiers for creating instances of these classes.
Always remember: if errors occurs check the first non-null return code (HRESULT) for the reason.
Like a "House of cards" lots of things can go wrong ;-)
dshow.h来自 DirectShow [ ^ ],它包含在Windows SDK中。
dshow.h is from DirectShow[^], which is included in the Windows SDK.
我解决了它添加:
I solved it adding:
#pragma comment(lib, "strmiids.lib")
我很惊讶lib文件没有包含在Microsoft文档中。
感谢所有回复的人。
I am surprised the lib file isn't included in the Microsoft documentation.
Thanks to all who replied.
这篇关于未解决的初学者外部...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文