专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Windows Mobile

纠结!求教一下"error LNK2005: "public: virtual _cdecl CUnknown:CUnknown(void)""的有关问题

发布时间:2010-05-30 01:01:18 文章来源:www.iduyao.cn 采编人员:星星草
纠结!急求教一下"error LNK2005: "public: virtual __cdecl CUnknown::~CUnknown(void)""的问题
我最近在molie上用driectshow对视频进行处理,但问题一直不段.下面是我写了一个简单的继承CTransformFilter类,但编译的时候一直出错

环境vs2008, windows mobile 6(vs2005和windows mobile也会出问题同样的错误)

1 .h
  #pragma once

  #include "streams.h"

  class CDSGrabber : public CTransformFilter
  {
  public:
CDSGrabber(TCHAR *, LPUNKNOWN, REFCLSID clsid);

~CDSGrabber(void);
  };

2 .cpp
  #include "StdAfx.h"
  #include "DSGrabber.h"


CDSGrabber::CDSGrabber(TCHAR *pName, LPUNKNOWN pUnk, REFCLSID clsid)
: CTransformFilter(pName, pUnk, clsid)
{
}

CDSGrabber::~CDSGrabber(void)
{
}

3 link lib
strmbase.lib
strmiids.lib

4 错误
1>uafxcw.lib(wcefont.obj) : error LNK2005: "public: virtual __cdecl CUnknown::~CUnknown(void)" (??1CUnknown@@UAA@XZ) already defined in strmbase.lib(amfilter.obj)
1>DSGrabber.obj : error LNK2019: unresolved external symbol "public: __cdecl CTransformFilter::CTransformFilter(wchar_t *,struct IUnknown *,struct _GUID const &)" (??0CTransformFilter@@QAA@PA_WPAUIUnknown@@ABU_GUID@@@Z) referenced in function "public: __cdecl CDSGrabber::CDSGrabber(wchar_t *,struct IUnknown *,struct _GUID const &)" (??0CDSGrabber@@QAA@PA_WPAUIUnknown@@ABU_GUID@@@Z)
1>DSGrabber.obj : error LNK2001: unresolved external symbol "public: virtual long __cdecl CTransformFilter::FindPin(wchar_t const *,struct IPin * *)" (?FindPin@CTransformFilter@@UAAJPB_WPAPAUIPin@@@Z)
1>DSGrabber.obj : error LNK2001: unresolved external symbol "public: virtual long __cdecl CBaseFilter::JoinFilterGraph(struct IFilterGraph *,wchar_t const *)" (?JoinFilterGraph@CBaseFilter@@UAAJPAUIFilterGraph@@PB_W@Z)
1>DSGrabber.obj : error LNK2001: unresolved external symbol "public: virtual long __cdecl CBaseFilter::QueryVendorInfo(wchar_t * *)" (?QueryVendorInfo@CBaseFilter@@UAAJPAPA_W@Z)
1>Windows Mobile 6 Professional SDK (ARMV4I)\Release\VCInterPhone.exe : fatal error LNK1120: 4 unresolved externals


------解决方案--------------------

关于你所描述的几个问题这里有解决方案:
http://apps.hi.baidu.com/share/detail/16803015

你自己编写的转换filter必须实现以下几个纯虚函数接口: 
CheckInputType
CheckTransform 
DecideBufferSize
GetMediaType 

记得散分哦!
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: