libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.
zlib License
431 stars 147 forks source link

SDL mixer tries to load opusfile.dll instead of libopusfile-0.dll #577

Closed W4RH4WK closed 11 months ago

W4RH4WK commented 11 months ago

I encountered an issue on Windows where I cannot initialize SDL mixer with OPUS support. I tracked the issue down to SDL mixer trying to load opusfile.dll at runtime while the provided DLL is actually named libopusfile-0.dll. Renaming the DLL solves the issue; however, I feel like this shouldn't be necessary. SDL mixer should look for libopusfile-0.dll.

The name of the opusfile library is provided by CMake via the compile definition OPUS_DYNAMIC.

SDL version: 2.28.4 SDL mixer version: 2.6.3

Edit: I just realized that when installing from source, the library is indeed named opusfile.dll. However, while the pre-built SDL mixer does not support OPUS, it comes with a libopusfile-0.dll. This is a bit confusing.

madebr commented 11 months ago

I fixed this in our vendored libraries, except gme and libxmp.

I hardcoded the soversions in the cmake script, so when bumping the dependencies, these should get reviewed. I also ignored MSVC, so msvc libraries will also have this version suffix, which is fine (imho). There is still a difference between MSVC binaries and mingw binaries: MSVC does not add a lib prefix.

Please test the new git commits, and comment here when you see something wrong. SDL3: 77546730c86524a83e9f69bceaf6a2e860075b6b SDL2: 9ec0e0e351846bbb3e2fcb3f007e528ed0c67c43