ksguid.lib linker issues
ksguid.lib has caused build problems for PA users:
[Portaudio] ksguid.lib problem
http://music.columbia.edu/pipermail/portaudio/2014-February/015774.html
[Portaudio] ksguid.lib?
http://music.columbia.edu/pipermail/portaudio/2013-October/015409.html
[Portaudio] Please help! linker error regarding 'ksguid.lib'
http://music.columbia.edu/pipermail/portaudio/2012-October/014471.html
[Portaudio] Needing ksguid.lib for VS2008 build
http://music.columbia.edu/pipermail/portaudio/2011-August/012848.html
[Portaudio] ksguid.lib and PA_WDMKS_NO_KSGUID_LIB
http://www.music.columbia.edu/pipermail/portaudio/2011-October/013004.htm
Apparently ksguid.lib is not available in the Windows 8.0a Platform SDK (see e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=731807 and discussion here:
[Portaudio] ksguid.lib (was: Re: Building examples with VC++ from VS2005)
http://www.music.columbia.edu/pipermail/portaudio/2014-December/016476.html
PortAudio currently has two separate dependencies on ksguid.lib:
1. The MSVC project file has AdditionalDependencies="ksguid.lib". I believe that this is for the wdmks host API, e.g. ksguid symbols are used directly by src/hostapi/wdmks/pa_win_wdmks.c (e.g. search for KSDATAFORMAT_*).
2. We conditionally provide pa_KSDATAFORMAT_* symbols at pa_win_wdmks_utils.c line 69 onwards, with an option to depend on ksguid.lib using #pragma comment( lib, "ksguid.lib" ) (pa_win_wdmks_utils.c is used by DirectSound and WMME channel detection logic).
Note that pa_win_wasapi.c defines its own copy of some pa_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT guids.
Proposal: centralise definition of pa_KS* GUIDs in a separate pa_win_ksguid.c/h file with no dependence on ksguid.lib. For each GUID, where the STATIC_* macro is available, use it. Otherwise hardcode the value as currently done in pa_win_wasapi.c.
[Portaudio] ksguid.lib problem
http://music.columbia.edu/pipermail/portaudio/2014-February/015774.html
[Portaudio] ksguid.lib?
http://music.columbia.edu/pipermail/portaudio/2013-October/015409.html
[Portaudio] Please help! linker error regarding 'ksguid.lib'
http://music.columbia.edu/pipermail/portaudio/2012-October/014471.html
[Portaudio] Needing ksguid.lib for VS2008 build
http://music.columbia.edu/pipermail/portaudio/2011-August/012848.html
[Portaudio] ksguid.lib and PA_WDMKS_NO_KSGUID_LIB
http://www.music.columbia.edu/pipermail/portaudio/2011-October/013004.htm
Apparently ksguid.lib is not available in the Windows 8.0a Platform SDK (see e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=731807 and discussion here:
[Portaudio] ksguid.lib (was: Re: Building examples with VC++ from VS2005)
http://www.music.columbia.edu/pipermail/portaudio/2014-December/016476.html
PortAudio currently has two separate dependencies on ksguid.lib:
1. The MSVC project file has AdditionalDependencies="ksguid.lib". I believe that this is for the wdmks host API, e.g. ksguid symbols are used directly by src/hostapi/wdmks/pa_win_wdmks.c (e.g. search for KSDATAFORMAT_*).
2. We conditionally provide pa_KSDATAFORMAT_* symbols at pa_win_wdmks_utils.c line 69 onwards, with an option to depend on ksguid.lib using #pragma comment( lib, "ksguid.lib" ) (pa_win_wdmks_utils.c is used by DirectSound and WMME channel detection logic).
Note that pa_win_wasapi.c defines its own copy of some pa_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT guids.
Proposal: centralise definition of pa_KS* GUIDs in a separate pa_win_ksguid.c/h file with no dependence on ksguid.lib. For each GUID, where the STATIC_* macro is available, use it. Otherwise hardcode the value as currently done in pa_win_wasapi.c.
Leave a comment
r1944 does the following: Removed MSVC dependence on ksguid.lib from src/os/win/pa_win_wdmks_utils.c (ksguid.lib is no longer in Platform SDK 8.0). Always use static instances of GUIDs like the GCC builds do. Removed ksguid.lib from MSVC project file. The following symbols are no longer used: PA_WDMKS_NO_KSGUID_LIB, PAWIN_WDMKS_NO_KSGUID_LIB; removed them from CMakeLists.txt and the MSVC project file.
Notes:
- With regard to pa_win_wdmks_utils.c this change has the same effect as if PA_WDMKS_NO_KSGUID_LIB was always defined.
- Change should only impact MSVC builds, as GCC never used ksguid.lib
- Change is mostly relevant to src/os/win/pa_win_wdmks_utils.c
- Since wdmks.lib was removed form the MSVC project file, it's possible that hostapi/wdmks and hostapi/wasapi may be negatively affected. However no issue was observed here with MSVC2005/SDK7.1A nor MSVC2013
Notes:
- With regard to pa_win_wdmks_utils.c this change has the same effect as if PA_WDMKS_NO_KSGUID_LIB was always defined.
- Change should only impact MSVC builds, as GCC never used ksguid.lib
- Change is mostly relevant to src/os/win/pa_win_wdmks_utils.c
- Since wdmks.lib was removed form the MSVC project file, it's possible that hostapi/wdmks and hostapi/wasapi may be negatively affected. However no issue was observed here with MSVC2005/SDK7.1A nor MSVC2013