How to Install MinGW (GCC/G++) Compiler in Windows 11 (2025)

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.พ. 2025
  • How to Install MinGW (GCC/G++) Compiler in Windows 11
    Learn how to install MinGW (Minimalist GNU for Windows) compiler on Windows 11 to write and compile C/C++ programs. MinGW provides a complete development environment for building Windows applications using GCC (GNU Compiler Collection) and G++. This step-by-step guide will walk you through the process of setting up MinGW on your Windows 11 system.
    ---
    Why Install MinGW?
    MinGW allows you to develop C/C++ programs on Windows using a free and open-source compiler. It’s widely used for cross-platform development and supports various tools like GCC, G++, and more.
    ---
    Steps to Install MinGW Compiler on Windows 11
    #### 1. *Download MinGW*
    Visit the official MinGW website:
    [MinGW.org](www.mingw.org/)
    Click on the *Downloads* tab.
    Select the *MinGW-w64 Installation* package compatible with your Windows architecture (e.g., 32-bit or 64-bit).
    Download the appropriate version (e.g., **MinGW-w64 GCC 12.x**) and save the installer to your system.
    #### 2. *Run the Installer*
    Once the download is complete, open the installer.
    Follow the installation steps:
    Choose the installation folder (default is fine for most users).
    Select packages (ensure `gcc`, `g++`, and other necessary tools are checked).
    Click *Next* and follow the on-screen instructions to install MinGW.
    #### 3. *Verify Installation*
    After installation is complete, open Command Prompt or PowerShell and check if MinGW is installed correctly by running:
    ```bash
    gcc --version
    ```
    and
    ```bash
    g++ --version
    ```
    #### 4. *Set Environment Variables*
    To use MinGW in your command line environment, set the necessary environment variables:
    Open **System Properties**:
    ```bash
    Right-click This PC - Properties - Advanced System Settings - Environment Variables
    ```
    Add MinGW’s path (`C:\MinGW\bin`) to both *System Variables* and **User Variables**.
    ---
    Optional: Using IDEs with MinGW
    If you prefer a more integrated development experience, consider installing IDEs like Code::Blocks, Visual Studio Code, or Eclipse alongside MinGW.
    ---
    Troubleshooting
    Ensure that Windows 11's *Defender Firewall* or *antivirus* is not blocking the installation.
    Check if Windows’ *Build Tools for Visual Studio* are not interfering with MinGW installation.
    With these steps, you’ll have MinGW set up and ready to compile your C/C++ programs on Windows 11. Happy coding!
    #MinGW #GCCCompiler #Windows11 #DevelopmentTools #CProgramming #CppProgramming #TechTutorial

ความคิดเห็น • 12