Closed invertego closed 9 months ago
I encountered this issue when building MAME, which currently recommends disabling portaudio when building with VS.
The exact linking error is along these lines:
dxguid.lib(dxguid.obj) : error LNK2005: KSDATAFORMAT_SUBTYPE_MIDI already defined in portaudio.lib(pa_win_wdmks.obj)
I'm honestly not sure this whole section of code - which seems to be just duplicating portions of guiddef.h - even ought to exist in portaudio. It appears to go back at least 16 years in age. That said, not being familiar with your build requirements, I thought I'd offer a minimally disruptive change.
mingw reference: https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/guiddef.h selectany reference: https://learn.microsoft.com/en-us/cpp/cpp/selectany
Match the behavior of guiddef.h in both mingw and the Windows SDK headers. This prevents linking errors caused by multiply defined symbols when linking against certain Windows SDK libs (like dxguid.lib).