Difference between revisions of "MinGW"

From UCT EE Wiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 28: Line 28:
  
 
= Use =
 
= Use =
 +
If you've added MinGW to your path, you should be able to open up command promt and run any of the commands available in the "bin\" directory of MinGW. For example if you installed the c++ compiler, running "c++: should look as follows:
 +
[[File:Mingw-c++-afterPATH.png|frame|left]]

Latest revision as of 13:45, 30 July 2020


MinGW, short for "Minimalist GNU for Windows", is a set of GNU tools designed to be run in Windows.

Download[edit]

There are many downloads available on the MinGW site, all listed here. A direct download to the installer for Windows is available at this link.

Install and Configure[edit]

When running through the installer, you can run through the default installation for the most part. It'll download some files, and then present you with a screen that looks as follows:

Mingw-install-manager.png

The basic setup tab compilers to install. For the most part, selecting mingw32-base-bin for the C compiler, and mingw-gcc-g++-bin for a C++ compiler will be all that's needed in undergrad courses. You can select packages for installation by clicking on them and selecting 'Mark for install".

Once you've selected the packages you want to install, on the top left bar select installation and then "Apply Changes". A new window will appear, with a list of packages to remove, upgrade and install. Click "Apply" to continue on with the installation. The packages will be installed, and when done, you will be given an option to close the dialog box. You can now close the MinGW Installation Manager.

Adding MinGW to PATH[edit]

In order to use the MinGW tools from the command line, you need to add them to your PATH. In order to do so, you need to ensure you know where MinGW was installed to. The default location is C:\MinGW\.

  1. Press the Windows key and type "path"
  2. Select "Edit Environment variables"
  3. In the dialog that opens, select "Environment variables"
  4. You should be presented with a dialog box with two text boxes. The top box shows your user settings. The PATH entry in this top 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!
  5. Click on the PATH entry in the TOP box, then click on the "Edit" button
  6. At the bottom of the list, add <installation-directory>\bin where "installation-directory" is the directory where MinGW was installed.
  7. press OK -> OK -> OK and you are done.

Use[edit]

If you've added MinGW to your path, you should be able to open up command promt and run any of the commands available in the "bin\" directory of MinGW. For example if you installed the c++ compiler, running "c++: should look as follows:

Mingw-c++-afterPATH.png