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. You should avoid installing into any directory or subdirectory having names like "Program Files" or "My Documents", etc.
No version numbering convention exists for MinGW as a whole. Each package has its own version number, and the installer version number does not correlate, in any way, with the version number of any individual package which it installs.
The preferred installation target directory is C:\MinGW
The preferred installation method is using the automated installer tool, as described below. While a manual installation is possible, we do not recommend it, unless you have a very old version of MS-Windows which is unable to run the graphical tool. Instructions for manual installation are provided below, if you really want (or need) to resort to it.
After installation you will need to perform some additional tasks yourself to ensure your MinGW applications will run. Most importantly, you will need to make changes to your PATH environment variable. Be careful: there are two PATH variables which can be changed, and changing the wrong one can have significant consequences. Instructions for changing the correct PATH variable are provided below.
You will also need to ensure you specify the correct installation target directory to the MinGW environment. While it is possible to install MinGW to a location other than C:\MinGW (e.g. on a different drive), you must ensure that the MinGW environment knows where it is located. Instructions for doing this are also provided below.
Graphical User Interface Installer
An automated GUI installer assistant called mingw-get-setup.exe is the preferred method for first time installation. This will guide you through the setup of the mingw-get installer proper; you will then use this to perform further package installations, and to manage your installation.
To perform your first time MinGW installation, you should proceed as follows:
- Click on this mingw-get-setup.exe link, to download the latest available version of mingw-get-setup.exe; ( Note: you should always download the latest available version of this; never use a possibly out-of-date copy, which may have been sitting on your local disk drive, or local network, for any appreciable period ).
- Locate the file you have downloaded, and double click on it to start the installer. ( Note: depending on your version of Windows, and on your local security policies, you may need to grant permission for this application to run ).
- Peruse the "blurb" of the opening dialogue, then click the Install button, to proceed with the installation.
- Review the installation options, as presented in the following dialogue. If you wish to change the installation directory, from the C:\MinGW offered by default, do please observe the warnings above, and reiterated within the dialogue, relating to path names with embedded spaces. Note that the CLI variant of mingw-get is always installed; the GUI variant is also installed by default, (and is highly recommended), but you may exclude it if you wish. It is recommended that you DO NOT select an "All Users" installation.
- When you have set the installation options to suit your preferences, click the Continue button to initiate the download and installation of mingw-get itself.
- At this juncture, mingw-get-setup.exe may complain that mingw-get appears to be installed already, and you will be offered an opportunity to run it directly, to reinstall, to select an alternative installation directory, or to abort this installation. If you really wanted to manage an existing installation, you should click Run Now. Alternatively, if you are trying to upgrade an existing installation of mingw-get itself, the Reinstall button is a safe choice to achieve this, or you may choose Change Directory if you prefer to create an alternative "side-by-side" installation.
When you have completed the foregoing procedure, to the point where mingw-get is installed, mingw-get-setup.exe will offer you a final choice:
- You may click the Quit button, to terminate mingw-get-setup.exe immediately. If you choose this option, you may then run mingw-get later, at your own convenience, to add packages or otherwise manage your MinGW installation.
- Alternatively, you may click the Continue button, to proceed immediately to package selection and installation. If you choose this option, you will be presented with the mingw-get GUI display, (via an integrated copy within mingw-get-setup.exe, even if you declined the option to install it permanently), where you may select and install packages to complete your initial MinGW installation.
When running the mingw-get GUI, (whether integrated within mingw-get-setup.exe, or free standing):
- You may observe that the window caption appears as "MinGW Installation Manager". However, the Help/About dialogue confirms that it is a component of the mingw-get application suite; "MinGW Installation Manager" may be considered synonymous with "mingw-get GUI".
- You may select from the (tree view) list of package categories, in the left hand pane of the application window, to see a refined list of packages in the upper right hand (list view) pane; the "Basic Setup" category represents (approximately) the choice of packages originally offered by the old, no longer supported mingw-get-inst.exe tool, (which mingw-get-setup.exe replaces).
- You may select any one package in the upper right (list view) pane, to see related information on the tabs of the lower right hand pane.
- At the time of writing, the list of packages associated with the "Basic Setup" category has been polluted by extraneous entries; ( cf. MinGW-Bug #2028 ). Strictly, only those packages designated as belonging to the bin component class should appear in this list.
- Unlike the case with mingw-get-inst.exe, you are no longer obliged to install any particular set of packages. If you do wish to install mingw-get-inst.exe's obligatory set, (including the GNU C Compiler, the GNU Debugger (GDB), and the GNU make tool), you should select the mingw-base package for installation.
To complete your initial installation, (or to subsequently manage it), using the mingw-get GUI, you should:
- Select a package category in the left hand (tree view) pane, to expose the package you wish to manage within the upper right hand (list view) pane; (for an initial installation, the Basic Setup category is a good choice, and is preselected by mingw-get-setup.exe).
- Select the package you wish to manage, (e.g. install), by clicking the icon to the left of its entry in the upper right hand (list view) pane.
- From the pop-up menu which appears, mark the package for subsequent application of the action you wish to perform, (e.g. Mark for Installation).
- Repeat the selection and marking operations, for any other packages you wish to manage.
- When you have completed selection and marking, open the Installation menu, (on the menu bar), and select the Apply Changes operation.
- Review the schedule of pending actions, then:
- Click the Apply button, to commit them.
- Click the Defer button, if you wish to modify your marked selections before committing them.
- Click the Discard button, to go back and start again, without committing anything.
After Installing You Should ...
- Open a Windows Explorer window and locate your installation directory (i.e. C:\MinGW, or any alternative you nominated during installation).
- Below your installation directory, you should find a directory named "msys", (normally in lower case letters, but mixed case, or all upper case is okay too); open this then find and open the additional subdirectories, "1.0" and "etc".
- Within the "etc" directory, there should be a file named "fstab"; (if not, create one, as a new text file). Open this with a text editor; (you should be able to do this by right clicking on it, and in the popup menu select "Open" or "Open With", although you may find that you need to select a suitable editor application to do so).
- Edit the file and ensure that it contains one line, (there may be others), which reads:
(substituting the FULL ABSOLUTE path of any alternative to C:\MinGW, which you nominated during installation); ensure that you follow this path name entry with at least one space, or tab, before typing the "/mingw" entry.
- Before you save the file, ensure that there is at least one blank line at the bottom, below all of the entries that may exist, then save and close the file.
Additionally, if you have installed MSYS, you are advised to create a start menu "MinGW Shell" shortcut in your "Start\Programs\MinGW" folder, (which you may also need to create); this should invoke the C:\MinGW\msys\1.0\msys.bat script, which is installed as a component of MSYS; (if you installed to an alternative directory, you should adjust the C:\MinGW prefix accordingly). Double clicking this shortcut will then open a command window with the correct environment set up for you, including the correct path references, allowing you to run any of the MinGW or MSYS applications within that command window.
If you ever intend to run MinGW or its applications using a cmd.exe window, you will need to make changes to your PATH environment variable. Instructions for doing so are listed in the Environment Settings section below.
Note: If you have installed MSYS as an add-on to MinGW, you do not need to change your PATH environment variable, ( unless you also want to make your MinGW applications available to the cmd.exe shell ).
Updating or Changing Your MinGW or MSYS Installation
There are two options for updating, adding, or removing components from your installation:
- Using the MinGW Installation Manager ( mingw-get GUI )
- Using the mingw-get CLI (Command Line Interface) Installer
Both methods will allow you to modify the original installation packages, in addition to the following available add-on packages:
- C++ (actually g++)
- 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)
Using GUI Installer Development Snapshots
The mingw-get application suite is under continuing development. If you are interested in participating in the evaluation and testing of the latest developments, even if your participation is limited to offering suggestions based on your user experience, your input will be greatly appreciated.
Currently, development snapshots are made available here, on an ad-hoc basis. To install the latest snapshot, simply download the (newer) mingw-get-setup.exe hosted there, and run it as if installing the released version.
Using the Command Line Interface Installer
The tool used for command line installation is called mingw-get. ( Note that this differs from mingw-get-setup.exe, which serves only to install mingw-get itself ). Although currently designated as a 'beta' release, mingw-get is capable of installing GCC 4.x and the basic (optional) MSYS shell environment recommended to support it.
(Since it is still under development, we ask that you 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 latest version of 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 freeware program such as 7-Zip.
After extracting the files, you will need to make changes to your user PATH environment variable. See the instructions in the section "Environment Settings" below now.
You should also read the section "After Installation You Should ..." above.
mingw-get is designed to facilitate management of any MinGW installation, entirely from the command line. To use it in this manner, therefore, after setting your user PATH appropriately, you should open a Command Prompt window. Click on "Start\Run" and enter "cmd" then click "OK". (Alternatively, you may prefer to start an MSYS shell, if you have installed that).
From the command (shell) prompt, if you simply wish to invoke the mingw-get GUI, you may do so simply by invoking
with no arguments. On the other hand, if you wish to perform any mingw-get installation management function directly from the command line, (e.g. to install the GNU C Compiler), you could type, at the prompt:
mingw-get install gcc
which will download and install the C compiler, and its requisite support packages; (i.e. its dependencies, which are mingwrt, w32api and binutils, for those interested).You may also install multiple independent packages together; 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 now 'C:\MinGW\MSYS\1.0'. The easiest way to start the shell is by running the msys.bat file found in that directory.
The first time you start the shell, you may also wish to run the command:
This is only a temporary measure to establish bindings between your MinGW and MSYS installations. The command will become unnecessary, when appropriate post-install scripting is added to the MSYS package catalogues.
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.
- The installers do not automatically modify any environment settings, (in particular the PATH). You will need to add the MinGW `bin' directory, as described in the "Environment Settings" section below.
- Administrative note The MinGW team do not recommend modifying the Windows PATH variable system wide. We prefer that you use a script to set PATH for the processes on a per session basis. This is the reason that we do not adjust the PATH.
- For versions of MSYS prior to MSYS-1.0.11; do not install MinGW into the same path as MSYS; (you may install to a subdirectory of the MSYS tree, as long as non-MSYS executables are not placed in the MSYS /bin directory). You probably don't have to worry about this.
- When you install both MSYS and MinGW, and have /mingw mapped to your MinGW directory (as is the default), if you then install ports, supplementary MinGW programs or dependency libraries, you are advised to install them into the /mingw directory tree, to ensure that they will be available for use with GCC; e.g. you should configure with
../path/to/configure --prefix=`cd /mingw; pwd -W`
(This latter form is preferred, when the program being installed is a native Windows binary, and the prefix may be hard coded into the executable).
When you install command line tools, such as MinGW, or GnuWin32 tools, you have to tell the command line interpreter where to find them. This is usually accomplished by adding the appropriate directory names to the PATH variable in your user environment. The installers will not do this for you.
NOTE If you choose to alter your PATH variable, you must ensure you alter your user PATH variable, not your system PATH variable -- there are two of them!
NOTE The MinGW team do not recommend modifying the system wide Windows PATH variable. We prefer that you use a script to set PATH for the processes on a per session basis. See the notes in the "After Installation You Should" section above.
Warning: Adding entries to the PATH is normally harmless. However, if you delete any existing entries, you may mess up your PATH string, and you could seriously compromise the functioning of your computer. Please be careful. Proceed at your own risk.
- Right-click on your "My Computer" icon and select "Properties".
- Click on the "Advanced" tab, then on the "Environment Variables" button.
- You should be presented with a dialog box with two text boxes. The top box shows your user settings. The PATH entry in this box is the one you want to modify. Note that the bottom text box allows you to change the system PATH variable. You should not alter the system path variable in any manner, or you will cause all sorts of problems for you and your computer!
- Click on the PATH entry in the TOP box, then click on the "Edit" button
- Scroll to the end of the string and at the end add
- press OK -> OK -> OK and you are done.
NOTE: Substitute <installation-directory> with the FULL absolute path name of the installation target directory you chose (ie C:\MinGW);
NOTE: If you installed MSYS, you may also want to add ";<installation-directory>\MSYS\1.0\local\bin", and ";<installation-directory>\MSYS\1.0\bin" to the end of your user PATH variable.
More information on Configuring and Using mingw-get is available.
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.