Installing MinGW - learnclang/1-helloworld GitHub Wiki

Since Windows doesn't come with a C compiler by default, we need to install one. In this case, we are going to install MinGW. You can find the latest version HERE

Running the Installer

Install MinGW using the following steps (based on this)

  • Select the button Install. The dialog Step 1: Specify Installation Preferences is opened.
    • Enter C:\MinGW (or any other valid directory name in the text input Installation Directory.
    • Check all checkboxes.
  • Select the button Continue. After the installation is finished, the window MinGW Installation Manager is displayed.
    • Select the list item Basic Setup in the listbox on the left.

    • Check the following checkboxes in the listbox on the right:

      • Package mingw-developer-toolkit; Class bin
      • Package mingw32-base; Class bin
      • Package mingw32-gcc-g++; Class bin
      • Package msys-base; Class bin

      MinGW - Installation Manager

Setting Environment Variables

Finally, you will need to set your environment variables:

  • Open a Windows Explorer Window
  • Right click on computer
  • Select Properties
  • Click on Advanced System Settings on the left sidebar
  • Click on Environment Variables
  • Add the following environment variable to the system:
    • MINGW_HOME with the value C:\MinGW
  • Add the following to the PATH environment variable:
    • %MINGW_HOME%\msys\1.0\bin;%MINGW_HOME%\bin

Once done, you'll need to restart your computer to make sure that the system picks up the new paths.

[Next: Writing hello world ->](MinGW Writing hello world)