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)