Sei sulla pagina 1di 3

Getting Started

• View
• Revisions

Posted May 22nd, 2007 by julienlecomte

• gcc
• getting started
• how to
• install
• mingw

This page will guide you through a typical, one size fits all, installation of MinGW. If you are
new to MinGW, you may wish to refer to the MinGW page to learn which tools it installs
(referred to as packages), and which tools perform which tasks. For more advanced installation
instructions, refer to HOWTO Install the MinGW (GCC) Compiler Suite. There is also some
introductory information for users who are new to MinGW.

MinGW Installation Notes

MinGW may have problems with paths containing spaces, and if not, usually other programs
used with MinGW will experience problems with such paths. Thus, we strongly recommend that
you do not install MinGW in any location with spaces in the path name reference; i.e. you should
avoid installing into any subdirectory of "Program Files" or "My Documents", or the like.

No version numbering convention exists for MinGW as a whole. Each package has its own
version number, and the installer version number does not necessarily reflect the version number
of any individual package which it installs.

Graphical User Interface Installer

The GUI installer is a graphical user interface to the CLI mingw-get installer described below.
To use it:

• Download and run mingw-get-inst.

• Select the directory to install MinGW, remembering the advice given above that the path
to this directory should not contain any spaces.
• Select the optional components to be installed, including the C++, Fortran, Objective-C,
and Ada compilers and MSYS.

The GUI installer will then download and run the mingw-get CLI installer to install GCC version
4.5. Note that make and gdb are installed automatically by the GUI installer. Before using
MinGW, you should add C:\MinGW\bin; to the PATH environment variable using the
instructions provided below.

The mingw-get-inst release notes contain more detailed information about the configuration and
use of the mingw-get-inst installer.

Command Line Interface Installer

The recommended tool for automated installation is mingw-get; although currently designated
'alpha', this is already capable of installing GCC 4.5 and the basic (optional) MSYS shell
environment recommended to support it. (Do note, however, that since it is still under
development, we may ask you to manually perform some follow-up actions, which you might
rightfully expect the installer to complete for you; eventually it will, but in the meantime, please
bear with us).

Download the mingw-get installer and extract the files to the C:\MinGW directory using a
program that can extract zip files. Recent versions of Windows may support this directly from
the Windows Explorer; alternatively you may use a program such as 7-Zip.

Add C:\MinGW\bin; to the PATH environment variable by opening the System control panel,
going to the Advanced tab, and clicking the Environment Variables button. If you currently have
a Command Prompt window open, it will not recognize the change to the environment variables;
you will need to open a new Command Prompt window to get the new PATH.

At the Command Prompt, type the command

mingw-get install gcc

to download and install the C compiler, and its requisite support packages; (mingwrt, w32api and
binutils, for those interested).

Additionally, you can specify any or all of the following additional packages:

• g++ (C++ compiler)

• fortran (Fortran 90/95 compiler)
• ada (Ada compiler)
• java (Java compiler)
• objc (Objective-C compiler)
• mingw32-make (GNU make)
• gdb (GNU debugger)
• msys-base (MSYS shell environment)

For example, the command

mingw-get install gcc g++ mingw32-make

will install the C compiler, C++ compiler, and make utility.

You can install more additional packages at any time. For example, the command

mingw-get install fortran gdb

will add the Fortran 90/95 compiler and debugger to the existing installation.

If you choose to also install 'msys-base', note that its default installation path is 'C:\MSYS\1.0',
and the easiest way to start the shell is by running the msys.bat file found in that directory. You
may also wish to run the command


within the MSYS shell, the first time you start it. (This is a temporary measure, to establish
bindings between your MinGW and MSYS installations; it will become unnecessary, when a
post-install scripting capability is added to mingw-get).

The mingw-get release notes contain more detailed information about the configuration and use
of the mingw-get installer. GCC documentation, make documentation, and GDB documentation
are available online.

Manual Installation
As an alternative to the automated installer, you may install MinGW by manually downloading
and extracting individual components. Please refer to HOWTO Install the MinGW (GCC)
Compiler Suite for information on manual installation.