School of Computing and Information Systems MinGW Installation Guide
This guide illustrates the installation of MinGW on a Windows 7 machine. Other Windows versions may differ.
Download the MinGW Installer
1. Navigate to the MinGW website at
https://sourceforge.net/projects/mingw/files/
and click “Download Latest Version”:
2. Save the installer to the Desktop.
1
Use the Installer to Download and Install the MinGW Shell and GCC Compiler
1. Run the the installer by locating it on the Desktop and double clicking it. You may need to say “yes, allow this program downloaded from the internet to execute”.
2. Step through the dialog boxes:
2
3. When the full dialog box opens with a list of software components, right-click “msys-base” and “mingw32-base-bin” and click “Mark for Installation”.
3
4. Click “Installation” (top left corner) and then click “Apply Changes”.
5. Click “Apply” and wait until installer prompts you with a message indicating completion.
4
Edit the PATH Variable (Windows 7, see below for Windows 10)
1. Open the Start Menu, right-click “Computer”, and click “Properties”
2. Click “Advanced system settings” and click “ Environment Variables”
5
3. Under“Systemvariables”scrolldowntothevariable“PATH”.Highlight(click)“PATH”andclick “Edit”
4. At the start of “Variable value” text-box add “C:\MinGW\bin;” Then agree to the changes by clicking the “OK”s
5. Close all windows and restart your computer
6
Edit the PATH Variable (Windows 10)
1. If you have any Command Prompt windows open, close them.
2. Click in the Cortana search box.
3. Type “environment variable”, and in the list of results, click “Edit the system environment vari- ables”.
4. Click“EnvironmentVariables…”
7
5. Under“Systemvariables”,select“Path”andclick“Edit…”
6. In the window that appears, click “New”
8
7. Type “C:\MinGW\bin” into the box. Then agree to the changes by clicking “OK” in all windows.
9
Create a MinGW Shell Shortcut
1. Navigate to the “msys.bat” file (located inside the MinGW folder).
2. Create a shortcut for the “msys.bat” file and rename the shortcut to “MinGW Shell”
10
3. (Optional) Add an icon to the “MinGW Shell” shortcut Right click on the icon =¿ properties, and select “Change Icon” from the “Shortcut” tab.
From the icon menu, select “Browse” and navigate to the installation folder (this is usually C:\MinGW\msys\1.0) and select one of the two provided icons.
11
4. Open the start menu, right click “All Programs” and click “Open”
5. Create a new folder in the “Programs Folder” called “MinGW”
12
6. Paste the “MinGW Shell” shortcut inside the folder.
You can now enjoy access to the MinGW Shell from the Start menu.
This is an alternative shell for interacting with Windows computers in a terminal window. Using the
MinGW shell (rather than cmd) has the benefit of providing Unix-like commands such as ls and more and so on, rather than the equivalent DOS commands. You’ll then be in a better position to mimic what you see on the screen in lectures, and also be more prepared for using the Unix servers to submit your assignments.
Try it!
Prepared by Michael James and Alistair Moffat, March 2014; revised by Alan Thomas, February 2018; revised by William Ellert, March 2019.
13