How to Create Visual Basic Script: Step-by-St...
Visual Basic Script short for VBScript is a lightweight...
The GNU Compiler Collection (GCC) is a free and great compiler system (C, C++, Fortran) that is the default on Linux and macOS. However, GCC (or another toolchain) is not included with Windows out-of-the-box and developers planning on using in Windows must install it on their own if they intend to look at or compile .c or .cpp programs locally.
Since Windows does not come pre-packaged with developer tools, such as gcc, g++, or make, the initial learning curve for novices can be really steep. Many have had issues running into environment variables, incompatible builds, or missing dependencies. This guide aims to ease that friction by guiding you through the MinGW-w64 installation method, a stable, lightweight, and well-supported distribution of GCC built specifically for the Windows platform.
We will test all steps on Windows 11, but this process should apply gcc for Windows 10 and 8.1 as well. Also, since we avoiding emulation layer such as WSL or a complete IDE, we will narrow the development environment down to MinGW-w64. This will be only native and portable.
MinGW-w64 is a fork of MinGW that is actively maintained and provides up to date modern versions of GCC with better 64-bit and multithreading support. It is well-suited for compiling modern C/C++ code and is fully POSIX thread compliant, abstracting developers from the underlying platform, useful for many cross-platform libraries (e.g libcurl).
MinGW-w64 is nothing like the other options. It’s a light-weight, portable, installer-free product that won’t bloat your system. If you want to build a minimal dev environment later, it works with editors (like VS Code or Sublime Text, etc.).
Compile C/C++ Projects on Optimized Windows VPS!
Set up GCC in minutes on Ultahost’s high-performance Windows VPS. Enjoy seamless development, zero-lag compiling, and 24/7 expert support!
One of the best ways to install GCC through the MinGW-w64 project, is to learn to begin a C/C++ compiler on Windows. This section, you will learn how to access binaries from a trusted GitHub source, set up the environment variable, and check that everything works as expected without running an installer.
To download gcc for windows, go to the official binary releases page on GitHub:
Look for the most recent stable release. Select the archive that matches your system, in most cases, users should select a 64-bit version with x86_64, posix, and seh in the file name. These settings dictate how the compiler is built to integrate with modern Windows systems and exception handling.
Download the .7z or .zip archive, and extract the file to an empty folder. In the folder you extracted, you’ll find sub folders and one of them will say mingw64/bin, or something similar, and here you’ll find gcc.exe, g++.exe, and all of the other compilers. This is your GCC binary path.
This method does not require an installer. Once the archive is extracted, the toolchain is ready to use. To be able to run gcc in any terminal window without having to navigate to the gcc executable folder each time, you will need to add the binary folder to the system PATH environment variable. This will tell Windows where the compiler is (in the bin folder) so you do not need to reference that folder each time.
To do this, open the Start Menu, search “Environment Variables”, and select Edit the system environment variables. When the System Properties window opens, click the Environment Variables button. Under System Variables, select the Path variable and click Edit. Create a new entry (as shown) and paste in the path to the bin folder you copied earlier:
Click OK on all open windows to apply changes. Open a new Command Prompt window and type:
gcc --version
If the setup is correct, it will show the installed GCC version along with build details.
Read also How to Install GCC Compiler on Linux
To test whether GCC works properly, write a simple C program. Open a text editor like Notepad and enter:
#include <stdio.h> int main() { printf("GCC is working!\n"); return 0; }
Save the file as hello.c in a folder such as C:\gcc_test.
Open Command Prompt, navigate to the folder:
cd C:\gcc_test
Then compile the program using:
gcc hello.c -o hello.exe
Run the executable:
hello.exe
You should see:
GCC is working!
If you encounter an error like “gcc is not recognized,” revisit the PATH variable setup and confirm the full path to the bin directory was added correctly. If the file compiles but doesn’t run, make sure you’re not working in a protected directory or one requiring admin rights.
Once verified, GCC is fully configured on your Windows system. You’re now ready to compile C and C++ programs directly from the command line.
If gcc is not recognized, double-check that the correct path was added to the system environment variables and that you opened a new Command Prompt after editing.
If you get a permissions issue, avoid saving or compiling files in system directories like C:\Windows or Program Files. Always work in folders where you have full read/write access.
If DLL-related errors appear on execution, use a build marked as “static” or ensure that required runtime libraries are present. The GitHub builds typically don’t have this problem unless they were incorrectly extracted.
Installing GCC on Windows can seem challenging, especially for new developers unfamiliar with environment variables or manual compiler setup. However, using the MinGW-w64 distribution simplifies the process by offering a lightweight, no-installer solution that’s easy to configure and fully compatible with modern C and C++ standards. This guide walked through downloading the correct binaries from GitHub, setting the system PATH, and compiling a test program—all using native tools without relying on WSL or third-party IDEs.
By choosing MinGW-w64, you avoid unnecessary complexity and get a portable, stable GCC environment directly on Windows. This method is ideal for students, hobbyists, and professionals alike who want a clean, efficient setup without leaving the Windows ecosystem. Once configured, you can confidently compile and run C or C++ code from the terminal, integrate with editors like VS Code, and build on this foundation for larger development projects.
Set Up GCC with Ease on UltaHost’s Windows 10 VPS for Reliable Development. Compile C/C++ applications effortlessly using MinGW-w64 on UltaHost’s high-performance Windows VPS. Enjoy full administrative access, native Windows compatibility, and fast NVMe storage—perfect for developers seeking a seamless GUI-friendly environment. With remote desktop access (RDP), reliable uptime, flexible scalability, and 24/7 expert support, UltaHost’s Windows Private Server is the ideal choice for stable and efficient GCC-based development.
Yes, MinGW-w64 is a more actively maintained fork that supports both 32-bit and 64-bit Windows targets, making it the better choice for modern development.
Yes, by downloading the MinGW-w64 binaries from a trusted source like GitHub, you can perform an offline installation by manually configuring the environment variables.
Yes, by downloading the MinGW-w64 binaries from a trusted source like GitHub, you can perform an offline installation by manually configuring the environment variables.
Open the Command Prompt and run: gcc --version
. If installed properly, it will display the GCC version number.
No, GCC works through the command line, but you can pair it with an IDE like Code::Blocks or Visual Studio Code for better productivity.
Yes, MinGW-w64 binaries are compatible with both Windows 10 and Windows 11.
Yes, as long as you download it from official or reputable sources like GitHub’s niXman releases, it’s safe and widely trusted by developers.
UltaAI – Smart AI Assistant for Ultahost Clients
UltaAI is your advisor for anything related to domain or hosting. Experience personalised suggestions.