编译一些网上的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)
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)
相关文章推荐
- 在使用android studio过程中,使用gradle编译的时候总会出现一些问题,下面是几个常见问题的解决方法。
- LDD3在Ubuntu下编译 scull例子时遇到的一些问题
- 经常写VC工程的人都会遇到升级到VS2005时出现的各种各样的问题,下面写一些自己遇到的问题,还有什么不全的请大家补充。希望能给朋友们一些帮助。
- 在做Asp.Net开发的时候,经常会遇到页面乱码的问题,下面是在网上收集的相关资料,请大家参考:
- ubuntu配置android开发环境和编译源码遇到的一些问题
- 使用虚拟机 vm 安装 ghost 系统的时候 遇到的一些问题
- 今天编译的时候遇到问题 报告R文件错误..
- 夜间模式demo做的时候遇到的一些问题
- 关于我遇到的java中编译没错运行出错的一些问题(不定期更新)
- VS2010编译的时候碰到winnt.h问题 ,DirectShow 在VS2005中环境配置
- Ubuntu7.04使用中遇到的问题及从网上搜集的解决办法(截止2007-11-3日) 收藏
- DirectShow Filter 编译时遇到的问题 ---- error MIDL2025 : syntax error : expecting ]... || error C2504: 'IReferenceClockTimerControl' :
- 将Eclipse文件导入到Android studio后编译遇到的一些问题(一)
- Win2003下面安装SQLSERVER2000遇到的一些问题及解决方案
- ubuntu配置android开发环境和编译源码遇到的一些问题
- 记录编译vnc-4_1_3-unixsrc的时候遇到的问题与解决办法
- 关于 DirectShow 中各个例子的编译转换问题
- x264和FFMPEG 编译后遇到的一些问题:UINT64_C,
- Windows在pip install tensorflow遇到的问题 一些python安装包的时候,超时问题以及权限问题
- 小白学python时候总会遇到的几个问题