You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building portaudio on Windows with MSVC & cmake as a shared library gives lots of warnings about export symbols defined multiple times. An example of the warning:
<path>/build/portaudio/build/portaudio.dir/Debug/exports.def : warning LNK4197:
export 'Pa_WriteStream' specified multiple times; using first specification
[<path>\build\portaudio\build\portaudio.vcxproj]
To Reproduce
Install MSVC Visual Studio or similar on Windows.
Check out portaudio code from git
Configure and build on windows.
cd portaudio
$cmake -G "Visual Studio 17 2022" -A x64 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DPA_BUILD_SHARED_LIBS=ON -S . -B build
$cmake --build build --config RelWithDebInfo
($cmake is a shortcut to the cmake provided by MSVC, which on my system is c:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Cmake\bin\cmake.exe)
Expected behavior
Successful build without any warnings
Actual behavior
Observe 57 warnings during linking, for each of the exported symbol from PA. It doesn't look like the warning actually affects the output and the generated shared library seems to work as expected.
Desktop (please complete the following information):
believe using WINDOWS_EXPORT_ALL_SYMBOLS TRUE is not wanted since portaudio define the symbols in cmake\portaudio.def.in. If this is wanted, a PR can be made.
The text was updated successfully, but these errors were encountered:
Describe the bug
Building portaudio on Windows with MSVC & cmake as a shared library gives lots of warnings about export symbols defined multiple times. An example of the warning:
To Reproduce
Install MSVC Visual Studio or similar on Windows.
Check out portaudio code from git
Configure and build on windows.
(
$cmake
is a shortcut to the cmake provided by MSVC, which on my system isc:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Cmake\bin\cmake.exe
)Expected behavior
Successful build without any warnings
Actual behavior
Observe 57 warnings during linking, for each of the exported symbol from PA. It doesn't look like the warning actually affects the output and the generated shared library seems to work as expected.
Desktop (please complete the following information):
Additional context
A fix for the problem is given by the following patch:
believe using
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
is not wanted since portaudio define the symbols in cmake\portaudio.def.in. If this is wanted, a PR can be made.The text was updated successfully, but these errors were encountered: