IID_IUnknown unresolved external symbol

Hi All,

I am trying to build a custom directshow filter in platform builder for WinCE 5.0.

At linking , it throws errors for unresolved external symbols for IID_IUnknown, IID_IClassFactory and IID_IPersist ..ie. all the interfaces I use in my filter. My filter inherits the CBaseFIlter class.

I have included uuid.lib, strmbase.lib , strmiids.lib.

Any idea what could be going wrong here

Do I have to define these values in my filter If yes .. what is the value

All suggestions are welcome !

Regards,

Ram



Answer this question

IID_IUnknown unresolved external symbol

  • CJ Clark

    Thank you for the help,

    I've now solved the problem. The linker was configured to build in pure CLR mode - obviously not compatible with COM!

    Regards,

    Si


  • chakravarthy_b

    I haven't done any CE development, so I'm not sure how much help I can offer. In regular windows, they are defined in uuid.lib.


  • Henry_Yang

    I don't know what more to say. You are getting a linker error, yes You might try asking in a more general c++ forum.

    You don't *have* to use a C++ class to implement an interface. First of all, you can write it in just standard c. It's harder, and not as clear (IMO), but it can be done. What's more, I do most of my DirectShow programming in c#.

    Just to be clear about what you are asking, there is a difference between implementing an interface, and using one that someone else has implemented.


  • DDarren

    Well, I'm not sure what to say. uuid.lib is where IID_IUnknown is defined in the PSDK.

    Now I don't know if things are different for Win CE, since I've never developed for it. A quick way to find where a symbol is defined is to use findstr. Something like:

    findstr /m IID_IUnknown *.lib

    This may show more than one lib, since some may just use the symbol instead of defining it, but still, it's a place to start.


  • explode

    I'm having the same problem - I'm getting the "unresolved symbol" error with IID_IUnknown.

    I've added uuid.lib to my project as an additional dependency in the linker config. An example from MSDN magazine that requires IID_IUnknown compiles and runs in Express with the PDSK properly installed so it's possible! It doesn't seem to be defined anywhere within the example project.

    The MSDN example is here: http://msdn.microsoft.com/msdnmag/issues/01/11/autoplay/

    I looked at the third project.

    If anyone has resolved this problem, TIA for any help!


  • Naveeeen

    Yes, for each of the IIDs that I'm trying to use I'm getting one "unresolved token" error, and one "unresolved external symbol" error. The compilation appears to finish without problems.

    I'd like to confirm which header file declares IID_IUnknown. I believe it's unknwn.h, although IID_IUnknown isn't found unless I include shlobj.h.

    The same file also contains a comment:

    IID_IUnknown and all other system IIDs are provided in UUID.LIB

    // Link that library in with your proxies, clients and servers

    Should it be adequate to include uuid.lib in the additional dependencies, or do I need to refer to it elsewhere

    Thanks again for your help!


  • Shaantu

    Glad you got it sorted out.
  • mr4100

    Thanks for the quick reply, LGS. I had a look at uuid.lib and I found the definition of IID_IUnknown but I couldn't see why my project wouldn't build. BTW I'm attempting to use the IQueryCancelAutoPlay interface from within a normal .NET Windows forms project. I've never used COM before and only started looking at it a couple of days ago, but I understand the concept of getting a pointer to an interface on an object and then using that pointer for all communication with the object. Is it necessary to use a C++ class in order to implement the interface

    Here's a code segment (without error handling), I'm trying to use the CLSID for IQueryCancelAutoPlay to create an instance and connect to its interface:

    IQueryCancelAutoPlay *pqca;

    IUnknown* punk;

    HRESULT hr = CoCreateInstance(AutoPlayCLSID,NULL,CLSCTX_LOCAL_SERVER,IID_IQueryCancelAutoPlay,(void**)&pqca);

    pqca->QueryInterface(IID_IUnknown, (void**)&punk);

    Appreciate any useful comments!


  • IID_IUnknown unresolved external symbol