Installation of GCC
Installing GCC varies depending on the operating system you are using. Here are the instructions for different platforms.
Installation on Linux
On most Linux distributions, you can install GCC using the package manager. For example:
Ubuntu
sudo apt update
sudo apt install build-essential
Fedora
sudo dnf install gcc gcc-c++
Installation on macOS
On macOS, you can install GCC using Homebrew:
brew install gcc
Installation on Windows
On Windows, you can install GCC as part of the MinGW-w64 or MSYS2 projects.
Using MSYS2
- Download and install MSYS2 from msys2.org.
- Open the MSYS2 shell and update the package database:
pacman -Syu
- Install GCC:
pacman -S mingw-w64-x86_64-gcc
Verifying the Installation
After installing GCC, you can verify the installation by checking the version:
gcc --version