INSTALLING C/GCC COMPILER FOR WINDOWS C/GCC COMPILER

Following are the steps to download and install the MinGW GCC Compiler for windows.

Step 1: Search MinGW C Compiler on the Web
To download the MinGW compiler, go to your favorite browser and search MinGW C Compiler or click on the 
sourceforge.net

Step 2: Download MinGW.
After clicking on the green-colored download button on the website, the MinGW setup file will start downloading.

Step 3: Locate the MinGW-get-setup.exe File and Start Installation.

Locate the setup.exe file on your Downloads folder and double-click on it.

After double-clicking on the setup file, MinGW Installation Manager Setup Tool will now open. It will show the information like version, name, etc. Click on the Install button and proceed to start the installation.

Step 4: Specify Installation Preferences.
Now the installation manager will ask you to specify the installation preferences. For that, you will be asked to choose the installation directory. If you wish to change it, you can browse the explorer and specify the location as per your requirement. After that, click on continue to proceed further.

It is recommended to install it in the default location

Step 5: Download and Set up MinGW Installation Manager.
The installer will now automatically download the required files for MinGW to install on your Windows system. Grab a cup of coffee and wait patiently till the installation manager finishes downloading all the files. When it is done, click on continue to proceed ahead.

NoteActive internet is required throughout the installation process.

Step 6: Select Packages Required for the Compiler.
There are three packages required for the basic MinGW setup that you have to choose from the MinGW Installation Manager.

1.MinGW32-base Package.
First, you have to install the MinGW32-base package. This package is used to compile the C program, including linker and other binary tools. Right-click on the MinGW32-base option and select Mark for Installation.

2.MinGW32-gcc-g++Package.
Now you have to install the MinGW32-gcc-g++ package. This package is used to compile C++ source code. This is an optional component of the MinGW Compiler. It is only required if you are going to program in C++ language only. To select the MinGW32-gcc-g++ right-click on it and select Mark for Installation.

3.MinGW32-gcc-objcpackage.
At last, you have to install the MinGW32-gcc-objc package. This package is used to compile objective C language. It is an optional component. It is only required if you are going to program in objective C. To select the MinGW32-gcc-objc package, right-click on it and select Mark for Installation.

Step7:ApplytheChanges
After selecting all the required packages, go to Installation>>Apply Changes and click on Apply Changes.

Step8:DownloadtheChanges.
Now it is time to download all the packages you selected in the previous step. Click on Apply and proceed further to download and install them.

The download for the packages will now begin, as shown in the window below. Wait for a few minutes until the download completes.

Step9:InstallationCompleted.
Now the installation has been completed, click on Close to close the Installation manager.

Now the installation of MinGW is finished. To check if it is installed or not, open Command Prompt and type g++ --version.

Currently, the command prompt cannot detect the MinGW compiler (GCC) because the environment path variable has not been set. The environment path variable helps to detect the compiler in your whole system. It makes the alias name for the compiler, which denotes the path. Follow the steps below to set the environment path variable for MinGW on the Windows system.