On Debian and variants,
<pre>sudo apt-get install mingw-w64
i686-w64-mingw32-gcc hello.cc -o hello32.exe      # 32-bit
x86_64-w64-mingw32-gcc hello.cc -o hello64.exe    # 64-bit
</pre>
From, <a href="http://www.tinc-vpn.org/examples/cross-compiling-64-bit-windows-binary/">cross compiling tinc for windows 64</a>.

<img class="aligncenter" src="http://i.imgur.com/C4buo.gif" alt="blown" />

Why did I not know about this? It's like I just discovered the screw driver.

The resulting binary will dynamically link to <code>kernel.dll</code> and <code>msvcrt.dll</code>. Target machine will therefore require an installation of the Microsoft C Runtime.

If your code depends on any other libraries, you'll need to either build or obtain them for windows. The link, above, goes through the motions of cross compiling several packages for windows from Linux; it's a different story for each project.

<h4>Cross-Compiling Boost: Building a Dependency</h4>

