src/data/roadmaps/cpp/content/installing-c@0J_ltQEJh2g28OE2ZEYJj.md
Before you can start programming in C++, you will need to have a compiler installed on your system. A compiler is a program that converts the C++ code you write into an executable file that your computer can run. There are several popular C++ compilers to choose from, depending on your operating system and preference.
For Windows, one popular option is to install the Microsoft Visual Studio IDE, which includes the Microsoft Visual C++ compiler (MSVC).
Alternatively, you can also install the MinGW-w64 compiler system, which is a Windows port of the GNU Compiler Collection (GCC). To install MinGW-w64, follow these steps:
bin folder inside the installation directory to your system's PATH environment variable.For macOS, you can install the Apple LLVM clang compiler which is part of the Xcode Command Line Tools. To do this, open a terminal and enter:
xcode-select --install
This will prompt a dialog to install the Command Line Tools, which includes the clang compiler.
On Linux, you can install the GNU Compiler Collection (GCC) through your distribution's package manager. Here are some examples for popular Linux distributions:
Ubuntu, Debian, and derivatives:
sudo apt-get install g++ build-essential
Fedora, CentOS, RHEL, and derivatives:
sudo dnf install gcc-c++ make
Arch Linux and derivatives:
sudo pacman -S gcc make
To confirm that the compiler is installed and available on your system, open a terminal/command prompt, and enter the following command:
g++ --version
You should see output displaying the version of your installed C++ compiler.
Now you're ready to start writing and compiling your C++ code!