Cross-compiling C programs for MS Windows using MinGW
2019-09-10As you may know, I tend to tinker on video games in my spare time. It's been a long time since I actually released anything worthwhile... but speaking of releases, there's always the question of multi-platform support. When making a browser game, the browser is your platform and you don't really worry about the OS underneath. When using a popular engine, you may test if the various releases work mostly as they should, but you're still mostly relying on the original developers' ability to make it run on all the platforms.
But things are vastly different when your game runs without an engine, or using an engine of your own making. You have to take care yourself of making sure the program runs fine on whichever platforms you want to support. But even before running, there's the matter of building – you have to actually compile the program for the target platform. One way to do this is, of course, having a machine running said platform (possibly in multi-boot), which comes with its own set of annoyances. The other solution is to cross-compile – and that's what I'm gonna shortly describe here.