EDN Admin
Well-known member
<span style="text-decoration:underline System Information
OS Name Microsoft Windows Vistaâ Business<br/>
Version 6.0.6002 Service Pack 2 Build 6002<br/>
Other OS Description Not Available<br/>
OS Manufacturer Microsoft Corporation<br/>
System Name SC081607<br/>
System Manufacturer Dell Inc.<br/>
System Model Precision WorkStation T5500<br/>
System Type X86-based PC<br/>
Processor Intel(R) Xeon(R) CPU E5504 @ 2.00GHz, 1995 Mhz, 4 Core(s), 4 Logical Processor(s)<br/>
BIOS Version/Date Dell Inc. A03, 9/9/2009<br/>
SMBIOS Version 2.5<br/>
Windows Directory C:Windows<br/>
System Directory C:Windowssystem32<br/>
Boot Device DeviceHarddiskVolume3<br/>
Locale United States<br/>
Hardware Abstraction Layer Version = "6.0.6002.18005"<br/>
Time Zone Eastern Daylight Time<br/>
Installed Physical Memory (RAM) 4.00 GB<br/>
Total Physical Memory 2.93 GB<br/>
Available Physical Memory 880 MB<br/>
Total Virtual Memory 6.07 GB<br/>
Available Virtual Memory 3.14 GB<br/>
Page File Space 3.23 GB<br/>
Page File Cagefile.sys
Microsoft Visual Studio 2010<br/>
Version 10.0.30319.1 RTMRel<br/>
Microsoft .NET Framework<br/>
Version 4.0.30319 RTMRel
Microsoft SDK Version 7.0A
Problem: I include the Microsoft header file "MMDEVICEAPI.H" in more than one source file, or more than one header file, or in the stdafx.h file and this produces a set of compile errors.
Result: I get the following errors:
Error 01 error LNK2005: _PKEY_AudioEndpoint_FormFactor already defined in xyz.obj ...<br/>
Error 02 error LNK2005: _PKEY_AudioEndpoint_ControlPanelPageProvider already defined in xyz.obj ...<br/>
Error 03 error LNK2005: _PKEY_AudioEndpoint_Association already defined in xyz.obj ...<br/>
Error 04 error LNK2005: _PKEY_AudioEndpoint_PhysicalSpeakers already defined in xyz.obj ...<br/>
Error 05 error LNK2005: _PKEY_AudioEndpoint_GUID already defined in xyz.obj ...<br/>
Error 06 error LNK2005: _PKEY_AudioEndpoint_Disable_SysFx already defined in xyz.obj ...<br/>
Error 07 error LNK2005: _PKEY_AudioEndpoint_FullRangeSpeakers already defined in xyz.obj ...<br/>
Error 08 error LNK2005: _PKEY_AudioEndpoint_Supports_EventDriven_Mode already defined in xyz.obj ...<br/>
Error 09 error LNK2005: _PKEY_AudioEndpoint_JackSubType already defined in xyz.obj ...<br/>
Error 10 error LNK2005: _PKEY_AudioEngine_DeviceFormat already defined in xyz.obj ...<br/>
Error 11 error LNK2005: _PKEY_AudioEngine_OEMFormat already defined in xyz.obj ...<br/>
Error 12 error LNK1169: one or more multiply defined symbols found xyz.dll 1 1 <project name>
<extract from mmdeviceapi.h>
// I believe this is the outer define block to prevent a duplicate include...<br/>
#ifndef __mmdeviceapi_h__<br/>
#define __mmdeviceapi_h__
#ifdef __cplusplus<br/>
extern "C"{<br/>
#endif
#ifdef DEFINE_PROPERTYKEY<br/>
#undef DEFINE_PROPERTYKEY<br/>
#endif<br/>
#ifdef INITGUID<br/>
#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) EXTERN_C const PROPERTYKEY name = { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }, pid }<br/>
#else<br/>
#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) EXTERN_C const PROPERTYKEY name<br/>
#endif // INITGUID<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_FormFactor, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 0);
<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_ControlPanelPageProvider, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 1);
<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Association, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 2);<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_PhysicalSpeakers, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 3);<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_GUID, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 4);<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Disable_SysFx, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 5);<br/>
#define ENDPOINT_SYSFX_ENABLED 0x00000000 // System Effects are enabled.<br/>
#define ENDPOINT_SYSFX_DISABLED 0x00000001 // System Effects are disabled.<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_FullRangeSpeakers, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 6);<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Supports_EventDriven_Mode, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 7);<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_JackSubType, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 8);<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEngine_DeviceFormat, 0xf19f064d, 0x82c, 0x4e27, 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c, 0);
<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEngine_OEMFormat, 0xe4870e26, 0x3cc5, 0x4cd2, 0xba, 0x46, 0xca, 0xa, 0x9a, 0x70, 0xed, 0x4, 3);
#ifdef __cplusplus<br/>
}<br/>
#endif
#endif
</extract from mmdeviceapi.h>
I do not believe these errors are conditioned on by-design coding. These definitions appear to collide creating a Microsoft compiler bug. Is there a newer version of this SDK covering WASAPI, or is there a posted fix somewhere.
jmsigler2<br/>
Dallas, TX
<br/>
View the full article
OS Name Microsoft Windows Vistaâ Business<br/>
Version 6.0.6002 Service Pack 2 Build 6002<br/>
Other OS Description Not Available<br/>
OS Manufacturer Microsoft Corporation<br/>
System Name SC081607<br/>
System Manufacturer Dell Inc.<br/>
System Model Precision WorkStation T5500<br/>
System Type X86-based PC<br/>
Processor Intel(R) Xeon(R) CPU E5504 @ 2.00GHz, 1995 Mhz, 4 Core(s), 4 Logical Processor(s)<br/>
BIOS Version/Date Dell Inc. A03, 9/9/2009<br/>
SMBIOS Version 2.5<br/>
Windows Directory C:Windows<br/>
System Directory C:Windowssystem32<br/>
Boot Device DeviceHarddiskVolume3<br/>
Locale United States<br/>
Hardware Abstraction Layer Version = "6.0.6002.18005"<br/>
Time Zone Eastern Daylight Time<br/>
Installed Physical Memory (RAM) 4.00 GB<br/>
Total Physical Memory 2.93 GB<br/>
Available Physical Memory 880 MB<br/>
Total Virtual Memory 6.07 GB<br/>
Available Virtual Memory 3.14 GB<br/>
Page File Space 3.23 GB<br/>
Page File Cagefile.sys
Microsoft Visual Studio 2010<br/>
Version 10.0.30319.1 RTMRel<br/>
Microsoft .NET Framework<br/>
Version 4.0.30319 RTMRel
Microsoft SDK Version 7.0A
Problem: I include the Microsoft header file "MMDEVICEAPI.H" in more than one source file, or more than one header file, or in the stdafx.h file and this produces a set of compile errors.
Result: I get the following errors:
Error 01 error LNK2005: _PKEY_AudioEndpoint_FormFactor already defined in xyz.obj ...<br/>
Error 02 error LNK2005: _PKEY_AudioEndpoint_ControlPanelPageProvider already defined in xyz.obj ...<br/>
Error 03 error LNK2005: _PKEY_AudioEndpoint_Association already defined in xyz.obj ...<br/>
Error 04 error LNK2005: _PKEY_AudioEndpoint_PhysicalSpeakers already defined in xyz.obj ...<br/>
Error 05 error LNK2005: _PKEY_AudioEndpoint_GUID already defined in xyz.obj ...<br/>
Error 06 error LNK2005: _PKEY_AudioEndpoint_Disable_SysFx already defined in xyz.obj ...<br/>
Error 07 error LNK2005: _PKEY_AudioEndpoint_FullRangeSpeakers already defined in xyz.obj ...<br/>
Error 08 error LNK2005: _PKEY_AudioEndpoint_Supports_EventDriven_Mode already defined in xyz.obj ...<br/>
Error 09 error LNK2005: _PKEY_AudioEndpoint_JackSubType already defined in xyz.obj ...<br/>
Error 10 error LNK2005: _PKEY_AudioEngine_DeviceFormat already defined in xyz.obj ...<br/>
Error 11 error LNK2005: _PKEY_AudioEngine_OEMFormat already defined in xyz.obj ...<br/>
Error 12 error LNK1169: one or more multiply defined symbols found xyz.dll 1 1 <project name>
<extract from mmdeviceapi.h>
// I believe this is the outer define block to prevent a duplicate include...<br/>
#ifndef __mmdeviceapi_h__<br/>
#define __mmdeviceapi_h__
#ifdef __cplusplus<br/>
extern "C"{<br/>
#endif
#ifdef DEFINE_PROPERTYKEY<br/>
#undef DEFINE_PROPERTYKEY<br/>
#endif<br/>
#ifdef INITGUID<br/>
#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) EXTERN_C const PROPERTYKEY name = { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }, pid }<br/>
#else<br/>
#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) EXTERN_C const PROPERTYKEY name<br/>
#endif // INITGUID<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_FormFactor, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 0);
<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_ControlPanelPageProvider, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 1);
<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Association, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 2);<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_PhysicalSpeakers, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 3);<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_GUID, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 4);<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Disable_SysFx, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 5);<br/>
#define ENDPOINT_SYSFX_ENABLED 0x00000000 // System Effects are enabled.<br/>
#define ENDPOINT_SYSFX_DISABLED 0x00000001 // System Effects are disabled.<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_FullRangeSpeakers, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 6);<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_Supports_EventDriven_Mode, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 7);<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_JackSubType, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 8);<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEngine_DeviceFormat, 0xf19f064d, 0x82c, 0x4e27, 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c, 0);
<br/>
DEFINE_PROPERTYKEY(PKEY_AudioEngine_OEMFormat, 0xe4870e26, 0x3cc5, 0x4cd2, 0xba, 0x46, 0xca, 0xa, 0x9a, 0x70, 0xed, 0x4, 3);
#ifdef __cplusplus<br/>
}<br/>
#endif
#endif
</extract from mmdeviceapi.h>
I do not believe these errors are conditioned on by-design coding. These definitions appear to collide creating a Microsoft compiler bug. Is there a newer version of this SDK covering WASAPI, or is there a posted fix somewhere.
jmsigler2<br/>
Dallas, TX
<br/>
View the full article