MinGW – compile windows software on Linux
Hot:sun MinGW   compile windows software on Linuxsun MinGW   compile windows software on Linuxsun MinGW   compile windows software on Linuxsun dark MinGW   compile windows software on Linuxsun dark MinGW   compile windows software on Linux

For all the windows developer out there, it is impossible to switch to Linux just because someone is looking for the Windows exe. Sooooooo bad. Not any more. There has been the MinGW compiler (and others) to compile the C programs on Linux box to run on Windows box. These cross compilers create windows exe and thus these can run on Windows natively without additional dll’s. That’s quite good, so how to do it.

Here’s how:

Fedora has decided to include the cross compiler in the repository . Login as root and do the following:

yum install mingw32-gcc mingw32-binutils mingw32-gtk2 mingw32-gtk-vnc mingw32-libvirt mingw32-libxml2 mingw32-nsis mingw32-nsiswrapper

This will install the required rpms to get you started. Now the part about getting started and getting software to run on windows. To get the programs compiled for windows, you can follow the simple guide here. This guide talks about compiling the software when the configure script is available.

But otherwise if you have a simple C or cpp to compile you can simply use the mingw compiler to compile the program and you get the exe that you can try out with wine or run on windows machine. Happy coding.

Example of the coding and compiling:

cat <<EOF > a.c

#include <stdio.h>
int main()
{
printf(“Amit Agarwal n”);
}
EOF

i686-pc-mingw32-gcc a.c

wine a.exe

careers
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • blogmarks
  • Blogosphere News
  • co.mments
  • HelloTxt
  • Ping.fm
  • Reddit
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Add to favorites
  • BlinkList
  • Diigo
  • email
  • Identi.ca
  • LinkedIn
  • Live
  • MyShare
  • MySpace
  • PDF
  • SheToldMe
  • Slashdot
  • Socialogs
  • Tumblr

related post

CBA0E3ABEB1A7038A3FD2A47BA03BC1B MinGW   compile windows software on Linux

Technorati Tags: Cross compile, Linux, mingw, Windows

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 comments so far

  1. abenteept

    June 25th, 2010 at 2:26 AM

    Hi Techlovers

    Do you want to know more on Spy Gadgets?

    There are many good sites which sell all kind of Spy gadgets like

    coca cola zero spy camera

    I am wondering which gadget would be good for me

    bye to all of you

  2. yes please

    August 23rd, 2010 at 7:42 PM

    thanks for the great post

Leave a reply
privacy

Back to top