Saturday, August 7, 2010

Easy way to setup build environment for Windows on Linux

Microsoft Windows is still the most popular desktop OS but not the most pleasant for the developers. Especially if you are creating open source application.
The MingW project delivers GCC and the tool-chain for building applications for Windows. Most popular libraries are also portable.
So it is possible to setup the cross-compilation environment to build Windows applications on Linux (Unix) system. But if you need to port the applications it is not always easy to get all the required libraries.
Yesterday I have discovered very convenient tool to setup MinGW cross compiling environment.
This tool, mingw-cross-env automatically downloads and builds mingw and several most popular libraries including Qt and GTK+.
To build my old ebook converter fit2pda I had to do the following steps.
  1. Download mingw-cross-env and build the required libraries (Qt):

    tar xzf mingw-cross-env-2.15.tar.gz
    cd mingw-cross-env-2.15
    make qt
  2. Setup PATH - add the string

    export PATH=/where mingw-cross-env is installed/usr/bin:$PATH
    to .bashrc

  3. Cross-compile fit2pda

    cd ~/projects/fit2pda
    i686-pc-mingw32-qmake
    make

That's all!
And the Windows version of the application is available.

No comments:

Post a Comment