0

I received this errors when trying to compile wince code:

Error   3   error LNK2019: unresolved external symbol "public: __thiscall CTransInPlaceFilter::CTransInPlaceFilter(wchar_t *,struct IUnknown *,struct _GUID const &,long *)" (??0CTransInPlaceFilter@@QAE@PA_WPAUIUnknown@@ABU_GUID@@PAJ@Z) referenced in function "private: __thiscall myFilter::myFilter(wchar_t *,struct IUnknown *,long *)" (??0myFilter@@AAE@PA_WPAUIUnknown@@PAJ@Z)   myFilter.obj    MyFilter
Error   4   error LNK2001: unresolved external symbol "public: virtual long __cdecl CTransformFilter::FindPin(wchar_t const *,struct IPin * *)" (?FindPin@CTransformFilter@@UAAJPB_WPAPAUIPin@@@Z)  myFilter.obj    MyFilter
Error   5   error LNK2001: unresolved external symbol "public: virtual long __cdecl CBaseFilter::JoinFilterGraph(struct IFilterGraph *,wchar_t const *)" (?JoinFilterGraph@CBaseFilter@@UAAJPAUIFilterGraph@@PB_W@Z)    myFilter.obj    MyFilter
Error   6   error LNK2001: unresolved external symbol "public: virtual long __cdecl CBaseFilter::QueryVendorInfo(wchar_t * *)" (?QueryVendorInfo@CBaseFilter@@UAAJPAPA_W@Z) myFilter.obj    MyFilter
Error   7   fatal error LNK1120: 4 unresolved externals WINCE600_SDK    MyFilter

I linked to project the necessary files like: strmbase.lib. I tried to see if strmbase.lib has c'tor for CTransInPlaceFilter (like error3), andI find it has, but different:

public: __thiscall CTransInPlaceFilter::CTransInPlaceFilter(unsigned short *,struct IUnknown *,struct _GUID const &,long *);

I can't cast wchar_t* to short*.

Is there a problem with my specific "strmbase.lib" or it's something I'm doing wrong?

Thank you!

user2004403
  • 193
  • 2
  • 13

1 Answers1

0

In early MS compiler versions, wchar_t was just an alias for unsigned short (which is a violation of the C++ standard), so that explains the implementation in strmbase.lib. With MSC 13, this became configurable, with MSC 14 it even became the default, if I remember correctly.

Now, you can flip this switch so that it matches the lib, but there are downsides to this, e.g. that you can't overload with wchar_t and unsigned short then. Maybe there is a better way though, but for that I'd ask which version of CE you are using and which compiler version you are using.

Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55
  • I'm using wince6. How can I know which version of compiler I use? I found a post explains it, but I don't have the same options as it says... – user2004403 Apr 03 '13 at 06:40
  • Open a command window and invoke the compiler "cl.exe" or "cl-.exe", which should be somewhere in your installation dir. However, which IDE are you using? Visual C++8 aka Visual Studio 2005 uses MSC 14, for example. You can also activate a flag so that the compiler outputs this when compiling in the IDE, I think it's called "banner" or something like that. – Ulrich Eckhardt Apr 03 '13 at 20:11