Installation of g++ compiler
Installation of GCC:
To install the GCC Compiler, we need to follow the steps:
1. Download the MinGW-w64 installer:
-
Go to the MinGW-w64 website:
-
Click on the âDownloadâ button to download the âmingw-get-setup.exeâ file.
2. Install MinGW:
- Run the âmingw-get-setup.exeâ file you just downloaded.
- Choose the installation directory (the default is usually âc:\MinGWâ).
3. Select and Install GCC Components:
- Open the MinGW Installation Manager âmingw-getâ.
- In the MinGW Installation Manager, select the following packages:
- âmingw32-gcc-g++": The GNU C++ compiler.
- âmingw32-gcc-objcâ: The GNU Objective-C compiler (optional).
- To select a package, check the box next to it.
- After selecting the packages, go to the âInstallationâ menu and click âApply Changes.â
4. Add MinGW to the System Path:
- Locate the âbinâ directory within your MinGW installation directory (e.g., âc:\MinGW\binâ).
Add the directory to your system.
- Open the windows and search
- Search for âEnvironment Variablesâ button.
- Under âUser variables,â find the âPathâ variable and click âEdit.â
- Click âNewâ and add the path to the âc:\MinGW\binâ directory.
- Click âOKâ to close all dialog boxes.
How do verify?
-
Open a new Command Prompt.
-
Run the following command to check the GCC version:
g++ --version
-
You should see the version information for GCC, confirming that it is installed correctly.