To run C++ programs, we need a compiler and a text editor or IDE.
A compiler translates C++ source code into executable programs.
Common compilers:
GCC (g++)
Clang
Microsoft Visual C++
Download and install MinGW / MinGW-w64
Select the g++ compiler during installation
Add the MinGW bin folder to the Path environment variable
Verify installation using:
Install Visual Studio
Select Desktop Development with C++
Compiler and IDE are installed automatically
Most Linux systems support GCC by default.
Install GCC:
Verify:
Install Xcode Command Line Tools:
Verify:
Code::Blocks
Dev-C++
Visual Studio
VS Code
Create a file:
Compile:
Run:
Windows: hello
Linux/macOS: ./hello
Programiz
OnlineGDB
Replit
After installing a compiler and editor, the C++ environment is ready to write, compile, and execute programs.
Take quizzes related to this topic and see where you stand!
Start Quiz Now