Cross compiling SDL2 - Dependency question

I’m trying to build a static library for sdl2 and sdl2_mixer using mingw so that build can be automated. Here is the docker file;

https://raw.githubusercontent.com/cfrankb/cs3-runtime-sdl/refs/heads/github-ci/docker/dockerfile-mingw32-static

The build is successful and can I can run the final executable using wine.

However, it cannot open xm files,

Mix_Init MOD error: MOD support not available

What other dependencies are needed for sdl2_mixer to get that “MOD support”?

If you just want to play xm modules, I would recommend the play routine from Romain Dalmaso (Artefact2).

Thanks for the suggestion. Unfortunately, getting your pick (libxm) to compile under Mingw turned into a nightmare. It was a good idea though.

I also compiled it with mingw but I only use the source code (not as a library).
It is easier to include the three c files (load.c, play.c, xm.c and the both headers) into your project.

That’s a good idea. Do you happen to have a working set of files (*.c, *.h) that you confirmed as working with mingw? If you had a small project that I can use as an example that might be even better.

I tried the current version of libxm. I tried older release. I just can’t get it to compile.
If it was just a few compilations issues that wouldn’t be a big deal.
Between warnings and errors, I see hundred of problems that I need to fix. Some of them undefined constants/enums. How did you address all those issues?

I will send you a little project. (today / evening).

Hello,

I packed a small example project for the xm music replay. The program can also play mod files (source from Michal Procházka)

  • Warning: There is an exe file for windows included
  • No event processing in the main loop.
  • My mingw version for windows: winlibs personal build version gcc-13.2.0-llvm-16.0.6-mingw-w64msvcrt-11.0.1-r1
  • music data (heritage.xm) is included as a header file
  • A code::blocks project included (xmplayer.cbp, xmplayer.depend,xmplayer.layout)
  • audio output with SDL2

Download link for xmplayer.zip:

Thank you. I’ll check this out today.