Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchFor a native GCC installation on Windows 11, the simplest current route is MSYS2 with the UCRT64 environment. It installs GCC, the MinGW-w64 Windows headers and libraries, build tools, and the pacman package manager in one setup.
You do not need to download a separate “MinGW” package or edit Windows PATH just to compile programs from the MSYS2 UCRT64 terminal. Follow the steps below to install GCC, verify it, and compile a small C program.
As an Amazon Associate I earn from qualifying purchases.
What you will install
MSYS2 is a Windows development distribution that provides native Windows compilers and Unix-style command-line tools. Its current recommended GCC environment is UCRT64, not the older MINGW64 environment.
| Component | Purpose |
|---|---|
| MSYS2 | Provides the terminal, package manager, libraries, and development tools |
| UCRT64 | 64-bit native Windows GCC environment using Microsoft’s Universal C Runtime |
pacman |
Installs and updates MSYS2 packages |
gcc |
Compiles C source files |
g++ |
Compiles C++ source files |
Older tutorials often tell beginners to select MINGW64. That advice is outdated: MSYS2 changed its default environment to UCRT64 in 2022, and MINGW64 is scheduled for deprecation on March 15, 2026.
#1 Best Overall
Check Windows 11 compatibility
MSYS2 requires 64-bit Windows 10 version 1809 or newer. Every supported Windows 11 installation meets that requirement, but your computer must still be running a 64-bit version of Windows.
To check, open Settings > System > About and look at System type. It should identify a 64-bit operating system and processor.
Step 1: Download MSYS2
- Open the official MSYS2 website.
- Download the installer matching your computer: the x64 installer for standard Intel or AMD Windows PCs, or the ARM64 installer for Windows on ARM.
- The current MSYS2 site lists
msys2-x86_64-20260611.exefor x64 Windows andmsys2-arm64-20260611.exefor ARM64 Windows. The filename may change when a newer release is published, so download from the official site rather than relying on an old copy.
Step 2: Install MSYS2
- Run the downloaded installer.
- On the Installation Folder screen, accept the default folder unless you have a specific reason to change it. The default is typically
C:msys64. - Continue through the installation wizard.
- Click Finish when the installation completes.
MSYS2 normally opens a UCRT64 terminal automatically after installation. If it does not, open the Start menu and launch MSYS2 UCRT64. This exact launcher matters; do not use ordinary Command Prompt, PowerShell, the plain MSYS terminal, or a manually launched sh.exe for the installation command.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Step 3: Install GCC
In the MSYS2 UCRT64 terminal, run:
pacman -S mingw-w64-ucrt-x86_64-gcc
MSYS2 will display the packages and dependencies that it plans to install. When it asks:
:: Proceed with installation? [Y/n]
press Enter. The default response is yes.
The package name is deliberately specific:
mingw-w64identifies the Windows-targeting toolchain.ucrtidentifies the UCRT64 environment.x86_64identifies the 64-bit target.gccis the compiler package, which also supplies the C++ compiler command used in this environment.
Step 4: Verify the installation
Still in the MSYS2 UCRT64 terminal, run:
gcc --version
You should see GCC version information instead of a “command not found” message. Do not expect one permanent version number: MSYS2 is a rolling-release distribution, so the installed version changes as packages are updated.
To see the exact package version installed through pacman, run:
pacman -Qi mingw-w64-ucrt-x86_64-gcc | grep Version
You can also check the C++ compiler:
g++ --version
Step 5: Compile a C program
Create a file named hello.c. You can use Notepad, Visual Studio Code, or the terminal. Put this code in the file:
Free tools Windows power users keep installed
One-click scans. No signup required.
#include <stdio.h>
int main(void) {
printf("Hello, Windows!n");
return 0;
}
In the UCRT64 terminal, change to the folder containing the file. For example, if you saved it in your Windows Downloads folder, use:
cd ~/Downloads
MSYS2 maps your Windows user profile into the Unix-style home path. You can also access a drive directly, such as /c/Users/YourName/Documents.
Compile the file with:
gcc hello.c -o hello.exe
If compilation succeeds, GCC creates hello.exe in the same folder. Run it with:
./hello.exe
The expected output is:
Hello, Windows!
The -o hello.exe option specifies the output filename. Without it, GCC normally creates an output file named a.exe, which is less descriptive.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Compile a C++ program
For C++, save a source file as hello.cpp and compile it with g++ rather than gcc:
g++ hello.cpp -o hello.exe
Run the resulting Windows executable from the same terminal:
Rank #2
./hello.exe
The UCRT64 launcher configures the shell so that /ucrt64/bin is searched before the regular MSYS /usr/bin directory. That is why the correct compiler is found automatically when you use the supplied launcher.
Do you need to add GCC to Windows PATH?
No, not if you use GCC inside the MSYS2 UCRT64 terminal. The UCRT64 launcher sets the required environment automatically.
You only need to add GCC to Windows’ own PATH if you want to run gcc from regular PowerShell, Command Prompt, or an IDE started outside MSYS2. With the default installation folder, add:
C:msys64ucrt64bin
On Windows 11, the usual route is:
- Open Settings > System > About.
- Click Advanced system settings.
- Click Environment Variables….
- Under User variables, select Path and click Edit. Using User variables avoids changing the setting for every account.
- Click New, enter
C:msys64ucrt64bin, and confirm with OK on each dialog. - Close and reopen PowerShell, Command Prompt, or your IDE.
Do not add C:msys64usrbin or the entire MSYS2 installation to Windows PATH. Exposing multiple MSYS2, Cygwin, MinGW, or other toolchain directories can make Windows select the wrong gcc, shell, linker, or DLL. If you use an external IDE, configure it to use the UCRT64 toolchain specifically.
Update MSYS2 correctly
MSYS2 is a rolling-release distribution and expects complete system upgrades. In the UCRT64 terminal, run:
pacman -Suy
A core update may ask to close all MSYS2 processes, including the current terminal:
Recommended Free Tools
:: To complete this update all MSYS2 processes including this terminal will be closed.
Confirm to proceed [Y/n]
Confirm the update. When the terminal closes, open MSYS2 UCRT64 again and run:
pacman -Suy
Run the command a second time because the first pass may update the MSYS2 runtime before the remaining packages can be updated. Avoid updating only GCC while leaving the rest of the MSYS2 installation outdated; partial upgrades are not the supported update model.
Fix common installation problems
“gcc: command not found”
Check the window title or prompt and make sure you opened MSYS2 UCRT64. The plain MSYS terminal is a different environment under /usr; it is not the native UCRT64 GCC terminal. Also confirm that the package installation completed:
pacman -Qi mingw-w64-ucrt-x86_64-gcc
If it is missing, run the installation command again from UCRT64.
You installed the wrong package
The current package name is:
mingw-w64-ucrt-x86_64-gcc
A package beginning with mingw-w64-x86_64- belongs to the older MINGW64 naming convention. Do not install a second unrelated MinGW distribution to compensate. Multiple toolchains commonly create PATH and library conflicts.
You launched sh.exe directly
Do not create a shortcut that runs sh.exe by itself. MSYS2 launchers set environment variables and start the appropriate login shell. Use the Start-menu shortcut for MSYS2 UCRT64.
PGP or maintainer-signature errors
If the installation has not been updated for roughly six months, package signatures may fail because the keyring is stale. First try:
Rank #3
pacman-key --refresh-keys
If MSYS2 reports that a new keyring is needed, use:
pacman -Sy msys2-keyring
pacman -Suy
SSL certificate errors
On corporate networks, proxies and antivirus software may inspect HTTPS traffic and replace the website’s certificate with a company or antivirus certificate. MSYS2’s OpenSSL does not automatically use the Windows certificate store. Errors may include self signed certificate in certificate chain or unable to get local issuer certificate.
Contact your network administrator for the approved certificate or proxy configuration rather than disabling certificate verification. The problem is with the network’s TLS interception, not with the GCC package itself.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Why MSYS2 UCRT64 is preferable to older guides
Older Windows GCC tutorials often combine an obsolete MinGW download, manual PATH changes, and separately downloaded DLLs. That approach makes it difficult to tell which compiler and runtime an IDE is using. MSYS2 keeps the compiler, libraries, and updates together, while UCRT64 provides the current recommended 64-bit GCC environment for Windows.
FAQ
Can I install GCC using Command Prompt or PowerShell?
You can use GCC from Command Prompt or PowerShell after adding C:msys64ucrt64bin to Windows PATH, but install it with pacman from the MSYS2 UCRT64 terminal. The UCRT64 launcher supplies the correct environment automatically.
Should I choose MINGW64 or UCRT64?
Choose UCRT64 for a new installation. MINGW64 is the older environment and is being deprecated; current MSYS2 guidance recommends UCRT64 for users who are unsure which environment to select.
Where is the compiled EXE file?
Unless you specify another path, it is created in the current terminal folder. For gcc hello.c -o hello.exe, the output is hello.exe in the same directory as hello.c.
Why does Windows say the program cannot start because a DLL is missing?
This usually means the program is being run outside an environment that can find its runtime DLLs, or that mixed toolchains were used. Use the UCRT64 toolchain consistently and avoid adding unrelated MSYS2, Cygwin, or MinGW directories to PATH.
Does installing GCC also install an editor?
No. GCC is a compiler, not a code editor. You can write source files with Notepad, Visual Studio Code, or another editor, then compile them from the MSYS2 UCRT64 terminal.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →The Bottom Line
Install MSYS2, open MSYS2 UCRT64, and run pacman -S mingw-w64-ucrt-x86_64-gcc. Verify with gcc --version, then compile with gcc hello.c -o hello.exe. Windows PATH changes are optional and are only needed when GCC must be launched from outside MSYS2.
For updates, use the complete MSYS2 upgrade command pacman -Suy rather than updating GCC in isolation.
Sources: MSYS2, MSYS2 environments, MSYS2 updating guide, and mingw-w64 MSYS2 instructions.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minute




