您的位置:首页 > 其它

编译一些网上的directshow的例子时候,总会遇到各种各样的问题,下面搜集如下:

2008-06-10 11:10 681 查看
appear to still be having problems with linking errors, i've managed to narrow it down to a few lines of code which cause the problem
Following the PushSource filter sample within the Platform SDK:

// directshow includes

#include <streams.h>

#include <initguid.h>

#include <Qedit.h> // for ISampleGrabber

#include <dvdmedia.h>

{8B578D13-87B2-488f-A4C1-AC8D065590D3}

DEFINE_GUID(CLSID_MyPushSource, 0x8b578d13, 0x87b2, 0x488f, 0xa4, 0xc1, 0xac, 0x8d, 0x6, 0x55, 0x90, 0xd3);

class MyPushSource : public CSource

{

public:

MyPushSource(IUnknown *pUnk, HRESULT *phr);

};

MyPushSource::MyPushSource(IUnknown *pUnk, HRESULT *phr)

: CSource(NAME("MyPushSource"), pUnk, CLSID_MyPushSource)

{

// do nothing yet

}

This code causes the following linking errors:

1>dracscrp.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall CSource::FindPin(unsigned short const *,struct IPin * *)" (?FindPin@CSource@@UAGJPBGPAPAUIPin@@@Z)

1>dracscrp.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall CBaseFilter::JoinFilterGraph(struct IFilterGraph *,unsigned short const *)" (?JoinFilterGraph@CBaseFilter@@UAGJPAUIFilterGraph@@PBG@Z)

1>dracscrp.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall CBaseFilter::QueryVendorInfo(unsigned short * *)" (?QueryVendorInfo@CBaseFilter@@UAGJPAPAG@Z)

The libraries which are included in my solution are:

strmbase.lib strmiids.lib quartz.lib winmm.lib vfw32.lib odbc32.lib odbccp32.lib atls.lib comsupp.lib

I feel I must have missed something, or have the newest DirectX SDK, and Platform SDK not got anything about the CSource any more, its really confusing me.

=================解决方法=====================

Look out for "Treat wchar_t as Built in type" option on the C/C++ Language tab. If you've been using an older version of strmbas* built from the base classes, you could have said "No" to this option. Change it back to "Yes".

还有一些链接错误,可以如下改正:

打开c/c++ >> Language >> Treat wchar_t as Built-in Type 设为 Yes.

Runtime Library ---->> Multi-threaded Debug(/MTd)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐