[wdmaudiodev] Re: Need help on IID_IMiniport

  • From: Matthew van Eerde <Matthew.van.Eerde@xxxxxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Fri, 2 May 2014 15:30:07 +0000

portcls.h has this line:

DEFINE_GUID(IID_IPowerNotify,
0x3DD648B8L, 0x969F, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3);

DEFINE_GUID is defined in guiddef.h as follows:

#ifdef INITGUID
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
        EXTERN_C const GUID DECLSPEC_SELECTANY name \
                = { l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }
#else
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
    EXTERN_C const GUID FAR name
#endif // INITGUID

INITGUID gets defined (or not) by #include <initguid.h> (or not.)

Since you want the GUID to be defined precisely once, you need to have 
precisely one .cpp file in your project that looks like this:

…
#include <initguid.h>
…
#include <portcls.h>
…

As long you have precisely one such .cpp file, you can have as many .cpp files 
you like that #include <portcls.h> without <initguid.h>.

From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Neetu Sand
Sent: Friday, May 2, 2014 5:29 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Need help on IID_IMiniport

Hi All,
I am trying to build a MIDI driver based on DDK sample. While building it is 
complaining about :

"error LNK2001: unresolved external symbol _IID_IPowerNotify"
"error LNK2001: unresolved external symbol _IID_IMusicTechnology"
"error LNK2001: unresolved external symbol _IID_IMiniport"
These GUIDs are defined in PortCls.h. I am adding Portcls.lib and Stdunk.lib 
for TARGET_LIBS but still I am getting these errors.
Any ideas on what am I doing wrong here?
cheers
Neetu

Other related posts: