Cross-compiling on Malus Sylvestris

After working my way through most of the migration to Mac, I came across a common problem for multi-platform developers like myself. The problem is the creation and use of applications targeted for another platform. For example, using a Linux compiler to develop Windows applications, or using an OS X compiler to develop Linux applications.

This is a fairly common problem, and also fairly simple to solve. The resultant tool kit is referred to as a Cross-Compiler, because is crosses platforms, and it compiles source code into target code. For Linux, my cross-compiler of choice was created and maintained by SDL, and can be found here. This allowed me to write Windows programs without needing to actually run Windows. Since both Linux and Windows were my complete set of frequented platforms, that sufficed. Now, however, one more platform has entered the mix. Fortunately, ECN/IRCCyN provides a cross-compiler, and it works just like other cross-compilers I’ve used. The only quirk with this one is that it installs to /usr/local/, which is “correct” but not so much for OS X. I mentioned this attribute in Part 1 of Malus Sylvestris Migration.

This tool is basically a port of GCC to OS X, but which generates code for Win32. If you’re familiar with GCC, you’re good to go. Just be sure to look in the right place for the program.