msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.25k stars 1.21k forks source link

Issues using SDL2_mixer with libmodplug when linked statically in mingw #3009

Open frranck opened 7 years ago

frranck commented 7 years ago

Hello, If I'm trying to compile SDL2_mixer and libmodplug statically in this game:

pacman -S mingw-w64-x86_64-toolchain
pacman -S mingw-w64-x86_64-SDL2main
pacman -S mingw-w64-x86_64-SDL2_mixer
pacman -S mingw-w64-x86_64-SDL2
pacman -S mingw-w64-x86_64-libmodplug
make clean
make mrboom LIBSDL2=1 MINGW=mingw64

It compiles but I'm getting this error at runtime "The specified module cannot be found" when trying to play a .MOD file. This seems to be related to some dynamic functions problem.

I'm able to go around this by compiling manually SDL2_mixer, configuring it this way:

./configure --prefix=/mingw64 --enable-shared=no --enable-music-mp3-smpeg==no --enable-music-ogg=no --enable-music-flac==no --enable-music-midi-timidity==no --enable-music-midi-native==no --enable-music-midi-fluidsynth==no --enable-music-mp3-smpeg=no --enable-music-mod-modplug-shared=no and by replacing the library.

What is the proper way to deal with this problem ? can it be done using pacman ?

Alexpux commented 6 years ago

@frranck we prefer dynamic linking, so maybe your problem in some package don't have static library or it link it not correctly

frranck commented 6 years ago

@Alexpux Both libmodplug and SDL2_mixer have .a files... I don't want dynamic linking it makes the packaging more complicated.

StarWolf3000 commented 6 years ago

./configure --prefix=/mingw64 --enable-shared=no --enable-music-mp3-smpeg=no --enable-music-ogg=no --enable-music-flac=no --enable-music-midi-timidity=no --enable-music-midi-native=no --enable-music-midi-fluidsynth=no --enable-music-mp3-smpeg=no --enable-music-mod-modplug=yes

frranck commented 6 years ago

@StarWolf3000 Sorry what's your point?

StarWolf3000 commented 6 years ago

@frranck Sorry, you just declared, that libmodplug will not be included as shared, which does not implicitly mean to use it as static.

frranck commented 6 years ago

@StarWolf3000 I said "I'm trying to compile SDL2_mixer and libmodplug statically in this game"

frranck commented 4 years ago

for the record:

I fixed my issue by compiling the lib with

./configure --prefix=/mingw64 --enable-shared=no --enable-music-mod-modplug=yes --enable-music-mod-modplug-shared=no --enable-music-flac=no --enable-music-mp3-mpg123=no --enable-music-opus=no --enable-music-ogg=no --enable-music-midi-timidity=no --enable-music-midi-fluidsynth=no

and applying this patch:

https://github.com/Javanaise/SDL_mixer/commit/c502c77e6d6d214871ba3129c1dd9f7212edcdce