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 whatever <code>msvcrt.dll</code>. If your code depends on any other libraries, you'll need to build or obtain those for windows, as well. 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>Using a Dependency in Binary Form</h4>



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