How to cross-platform compile on windows for linux using gcc?
<p>My aim is to create cross-platform C++ python modules.
I'm using<code>Cyther</code> (cross-platform The Cross-Platform Cython/Python Compiler).</p>

<p>Cyther uses <code>GCC</code> to compile modules and gives the user the ability to add GCC command-line args.</p>

<p>So, I need run compiler on Windows, but compile for Linux. What args I must pass to GCC to compile a module for Linux (or other platform)? </p>

<p>Is this possible, if so how?</p>

<p>Gcc must be built separately for each compilation target. It can be built for any target on any host. The target you need is <code>i386-linux-gnu</code> (or often <code>i586-linux-gnu</code>) for 32-bit and <code>x86_64-linux-gnu</code> for 64-bit Linux.</p>

<p>Note that it provides separate binaries, <code>i386-linux-gnu-gcc</code>, <code>x86_64-linux-gnu-gcc</code> etc. Parameters are then the same.</p>

<p>I am not sure anybody provides that, but you can build it yourself. A tool to help you with that is described in <a href="http://stackoverflow.com/questions/4769968/c-cross-compiler-from-windows-to-linux">C++ cross-compiler from Windows to Linux</a>.</p>

<p>Or you can go the simpler way and build on Linux (including cross-compilation to Windows). This kind of things is just so much easier on a decent Linux distribution.</p>

python c++ linux gcc cross-compiling