[Tips] Cross-Compiling on Windows for Linux

Have you ever wanted to compile Linux binaries under Windows? This is how it

1. Get Cygwin setup.exe: http://www.cygwin.com/
1.1. Run setup.exe and continue to package selection list.
1.2. Under Devel catagory select tools you need for compiling your source. For example ‘GNU make’.
1.3. Finish installing.

2. Get linux cross-compilers for cygwin:
“cygwin-gcc-linux.tar.bz2” (68.2 Mb). md5sum: 340e91a346f5bb17e660db10e43005b8
These compilers are made with crosstool 0.28-rc37. This package contains:
gcc-3.3.4 and gcc-2.95.3 for i386 (glibc 2.1.3) and gcc-3.3.3 for amd64
(glibc 2.3.2).


Note! There is now newer version of GCC avaible with glibc 2.3.2:
“cygwin-gcc-3.3.6-glibc-2.3.2-linux.tar.bz2 (i386, x86_64)”.
2.1. Copy ‘cygwin-gcc-linux.tar.bz2’ to ‘c:\cygwin’ or install directory which you selected in setup.exe.
2.2. Open Cygwin shell and change directory to root with ‘cd /’.
2.3. Uncompress to Cygwin root with command:
‘tar -jxvf cygwin-gcc-linux.tar.bz2’.

Cross-compilers are installed under ‘/opt/crosstool’. You can use them directly or with commands: gcc-linux, g++-linux, gcc-linux-2.95, g++-linux-2.95, gcc-linux-x86_64 and g++-linux-x86_64.

source : http://metamod-p.sourceforge.net/cross-compiling.on.windows.for.linux.html


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s