Mingw32 and SDL_Mixer

Hi

I am trying to cross compile SDL_Mixer-1.2.6 with mingw32 under Linux.

cross-configure did work fine. However I got some compilation errors:

i386-mingw32msvc-gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME=""
-DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT=""
-DPACKAGE=“SDL_mixer” -DVERSION=“1.2.6” -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
-DHAVE_UNISTD_H=1 -I. -I. -g -O2
-I/usr/local/cross-tools/i386-mingw32msvc/include/SDL -Dmain=SDL_main
-DUSE_RWOPS -DCMD_MUSIC -DWAV_MUSIC -DLIBMIKMOD_MUSIC -D_REENTRANT -DMID_MUSIC
-DUSE_TIMIDITY_MIDI -I./timidity -DUSE_NATIVE_MIDI -I./native_midi -MT music.lo
-MD -MP -MF .deps/music.Tpo -c music.c -DDLL_EXPORT -DPIC -o .libs/music.o
music.c:54:22: mikmod.h: No such file or directory
music.c:112: error: syntax error before "UNIMOD"
music.c:112: warning: no semicolon at end of struct or union
music.c:112: warning: no semicolon at end of struct or union
music.c:128: error: syntax error before ‘}’ token
music.c:128: warning: data definition has no type or storage class
music.c:133: error: syntax error before ‘}’ token
music.c: In function `music_mixer’:
music.c:176: error: dereferencing pointer to incomplete type
etc…

Can anyone help me on this?

Thanks

Fred

Fred Perie <f.perie tiscali.fr> writes:

Hi

I am trying to cross compile SDL_Mixer-1.2.6 with mingw32 under Linux.

cross-configure did work fine. However I got some compilation errors:

i386-mingw32msvc-gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME=""
-DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT=""
-DPACKAGE=“SDL_mixer” -DVERSION=“1.2.6” -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
-DHAVE_UNISTD_H=1 -I. -I. -g -O2
-I/usr/local/cross-tools/i386-mingw32msvc/include/SDL -Dmain=SDL_main
-DUSE_RWOPS -DCMD_MUSIC -DWAV_MUSIC -DLIBMIKMOD_MUSIC -D_REENTRANT -DMID_MUSIC
-DUSE_TIMIDITY_MIDI -I./timidity -DUSE_NATIVE_MIDI -I./native_midi -MT music.lo
-MD -MP -MF .deps/music.Tpo -c music.c -DDLL_EXPORT -DPIC -o .libs/music.o
music.c:54:22: mikmod.h: No such file or directory
music.c:112: error: syntax error before "UNIMOD"
music.c:112: warning: no semicolon at end of struct or union
music.c:112: warning: no semicolon at end of struct or union
music.c:128: error: syntax error before ‘}’ token
music.c:128: warning: data definition has no type or storage class
music.c:133: error: syntax error before ‘}’ token
music.c: In function `music_mixer’:
music.c:176: error: dereferencing pointer to incomplete type
etc…

Can anyone help me on this?

Thanks

Fred

Well I tried to copy mikmod.h from the mikmod directory and compilation resumed
perfectly. I still got a problem when linking SDL_mixer.dll

i386-mingw32msvc-gcc -shared .libs/SDL_mixer.dll.def .libs/load_aiff.o
.libs/load_voc.o .libs/load_ogg.o .libs/mixer.o .libs/music.o .libs/music_cmd.o
.libs/music_ogg.o .libs/wavestream.o .libs/effect_position.o
.libs/effect_stereoreverse.o .libs/effects_internal.o -Wl,–whole-archive
timidity/.libs/libtimidity.a native_midi/.libs/libnativemidi.a
-Wl,–no-whole-archive -L/usr/X11R6/lib -L/usr/lib -lwinmm
-L/usr/local/cross-tools/i386-mingw32msvc/lib -lmingw32 -lSDLmain
/usr/lib/libSDL.so /usr/lib/libmikmod.so -lpthread -ldl -lm -mwindows -o
.libs/SDL_mixer.dll -Wl,–enable-auto-image-base
-Wl,–out-implib,.libs/libSDL_mixer.dll.a
/usr/lib/libSDL.so: could not read symbols: Invalid operation

Any clue?

Thanks

Fred

Fred Perie wrote:

I am trying to cross compile SDL_Mixer-1.2.6 with mingw32 under Linux.

cross-configure did work fine. However I got some compilation errors:

i386-mingw32msvc-gcc -DPACKAGE_NAME="" -DPACKAGE_TARNAME=""
-DPACKAGE_VERSION="" -DPACKAGE_STRING="" -DPACKAGE_BUGREPORT=""
-DPACKAGE=“SDL_mixer” -DVERSION=“1.2.6” -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
-DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1
-DHAVE_STDINT_H=1
-DHAVE_UNISTD_H=1 -I. -I. -g -O2
-I/usr/local/cross-tools/i386-mingw32msvc/include/SDL -Dmain=SDL_main
-DUSE_RWOPS -DCMD_MUSIC -DWAV_MUSIC -DLIBMIKMOD_MUSIC -D_REENTRANT
-DMID_MUSIC -DUSE_TIMIDITY_MIDI -I./timidity -DUSE_NATIVE_MIDI
-I./native_midi -MT music.lo -MD -MP -MF .deps/music.Tpo -c music.c
-DDLL_EXPORT -DPIC -o .libs/music.o
music.c:54:22: mikmod.h: No such file or directory

Well I tried to copy mikmod.h from the mikmod directory and compilation
resumed perfectly. I still got a problem > when linking SDL_mixer.dll

i386-mingw32msvc-gcc -shared .libs/SDL_mixer.dll.def .libs/load_aiff.o
.libs/load_voc.o .libs/load_ogg.o .libs/mixer.o .libs/music.o
.libs/music_cmd.o
.libs/music_ogg.o .libs/wavestream.o .libs/effect_position.o
.libs/effect_stereoreverse.o
.libs/effects_internal.o -Wl,–whole-archive timidity/.libs/libtimidity.a
native_midi/.libs/libnativemidi.a -Wl,–no-whole-archive -L/usr/X11R6/lib
-L/usr/lib -lwinmm -L/usr/local/cross-tools/i386-mingw32msvc/lib -lmingw32
-lSDLmain /usr/lib/libSDL.so /usr/lib/libmikmod.so -lpthread -ldl -lm
-mwindows
-o .libs/SDL_mixer.dll -Wl,–enable-auto-image-base
-Wl,–out-implib,.libs/libSDL_mixer.dll.a
/usr/lib/libSDL.so: could not read symbols: Invalid operation

It looks like the cross-configure did not work fine. I see that a bunch of
Linux things got detected (and not Mingw). For example, I do not believe
Mingw ships with libmikmod and if you did not build your own for Mingw the
-DLIBMIKMOD_MUSIC if the source of your “music.c:54:22: mikmod.h: No such
file or directory” problem (and during linking “/usr/lib/libmikmod.so” goes
against a Linux libmikmod, of course).
Also during linking, things like “-L/usr/X11R6/lib -L/usr/lib
/usr/lib/libSDL.so” are a big problem.

-Alex.

Thanks Alex. I have absolutely no idea how to fix cross-configure. I just took
the one libsdl.org site. What can I do? I have no experience with configure file.

Fred