Setup and configure MinGW

From Carboogle

Contents

Overview

MinGW is a tool that you can use to build some linux app under windows.

Official website: http://www.mingw.org/

Installation

You need to download three files (note that version can change):

  1. MinGW-5.1.3.exe: The runtime. I have installed the full version
  2. MSYS-1.0.10.exe: The command prompt with some tools
  3. msysDTK-1.0.1.exe: Building tools (autoconf, automake, make, ...)

Install them in the order above and you are ready to compile !

I have also installed the following updates:

  • bash-3.1-MSYS-1.0.11-snapshot.tar.bz2
  • bison-2.0-MSYS.tar.gz
  • file-4.16-MSYS.tar.bz2
  • gdb-6.6.tar.bz2
  • insight-6.6-mingw.tar.bz2
  • join_paste_textutils-2.1-MSYS.tar.bz2
  • m4-1.4.7-MSYS.tar.bz2
  • mktemp-1.5-MSYS.tar.bz2
  • msys-autoconf-2.59.tar.bz2
  • msys-automake-1.8.2.tar.bz2
  • msys-libtool-1.5.tar.bz2

Configuration

Folders

Edit fsab (pico /etc/fstab) and be sure it is like this:

c:/programs/MinGW /mingw
D:/data/repositories/mingw/local /local
D:/data/repositories/mingw/local /usr/local 
  • The first entry is required and should be here by default after installing msys
  • The second entry is optional: i just want to separate my local folder that is backuped and contains compiled data, from the installation directory
  • The third line is required for some programs to configure scripts that needs a /usr/local (like glib)

Compiler flags

Edit /etc/profile and add at the end:

export CFLAGS="-I/local/include"
export LDFLAGS="-L/local/lib"
export PKG_CONFIG_PATH="/local/lib/pkgconfig"
  • First and second line are required for some configure scripts to run (like glib)
  • Third line is used by pkg-config to search libraries

cc Compiler

There is no cc.exe, so to build for example Berkeley DB you will need to symlick it to gcc.exe

ln -s /mingw/bin/gcc.exe /mingw/bin/cc.exe

Mycila.com

Mycila projects

Other projects

ports

articles

lessons