Windows

  1. Install MinGW:

    • Download the MinGW installer from MinGW website and run it.
    • Select “Basic Setup” and choose the GCC compiler suite during installation.
  2. Set Path (Optional):

    • Add MinGW bin directory to system PATH variable for command line access.
  3. Verify Installation:

    • Open Command Prompt and type:
        gcc --version
        

macOS

  1. Install Xcode Command Line Tools:

    • Open Terminal and run:
        xcode-select --install
        
  2. Verify Installation:

    • Open Terminal and type:
        gcc --version
        

Linux (CentOS/RHEL using yum)

  1. Install GCC:

    • Update package list and install GCC:
        sudo yum update
      sudo yum install -y gcc
        
  2. Verify Installation:

    • Open Terminal and type:
        gcc --version
        

Linux (Ubuntu/Debian using apt)

  1. Install GCC:

    • Update package list and install GCC:
        sudo apt update
      sudo apt install -y gcc
        
  2. Verify Installation:

    • Open Terminal and type:
        gcc --version