On this page
Installing C++ Compiler
To start programming in C++, you’ll need to set up a development environment with a compiler and optionally an Integrated Development Environment (IDE) or text editor.
Windows
-
Install MinGW:
- Download the MinGW installer from MinGW website and run it.
- During installation, choose “Basic Setup” and select the GCC compiler suite.
-
Set Path (Optional):
- Add MinGW
bin
directory to the system PATH variable for command-line access.
- Add MinGW
-
Verify Installation:
- Open Command Prompt and type:
g++ --version
- Open Command Prompt and type:
macOS
-
Install Xcode Command Line Tools:
- Open Terminal and run:
xcode-select --install
- Open Terminal and run:
-
Verify Installation:
- Open Terminal and type:
g++ --version
- Open Terminal and type:
Linux (CentOS/RHEL using yum
)
-
Install GCC:
- Update package list and install GCC:
sudo yum update sudo yum install -y gcc-c++
- Update package list and install GCC:
-
Verify Installation:
- Open Terminal and type:
g++ --version
- Open Terminal and type:
Linux (Ubuntu/Debian using apt
)
-
Install GCC:
- Update package list and install GCC:
sudo apt update sudo apt install -y g++
- Update package list and install GCC:
-
Verify Installation:
- Open Terminal and type:
g++ --version
- Open Terminal and type: