How to Install GCC on Windows with w64devkit

Published: (February 16, 2026 at 11:18 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

Installing w64devkit

  1. Go to the w64devkit GitHub releases page and download the latest .zip archive.
  2. Extract the contents to a folder of your choice (e.g., C:\w64devkit).
    No further installation steps are required.

Launching the w64devkit terminal

  • Locate w64devkit.exe in the folder you extracted.
  • Double‑click it to open a pre‑configured MinGW64 shell.
# Example: your project is in C:\Users\YourUser\Documents\MyCProject
cd /c/Users/YourUser/Documents/MyCProject

Use forward slashes (/) for paths in this Unix‑style shell.

Compiling C programs with GCC

Simple compilation

gcc main.c -o main_executable
  • main.c – source file
  • -o main_executable – name of the resulting executable (main_executable.exe)

Common compilation flags

  • -Wall  Enable a broad set of warnings.
  • -Wextra Enable additional warnings beyond -Wall.
  • -Werror Treat all warnings as errors, forcing you to fix them.
  • -std=c99 Target the C99 language standard.
  • -o Specify the output executable name.

Example for a multi‑file project

gcc -Wall -Wextra -Werror -std=c99 main.c array_helpers.c -o peak_finder

This compiles main.c and array_helpers.c, applies the selected warnings (as errors), adheres to the C99 standard, and produces peak_finder.exe.

Running the executable

./peak_finder

The ./ prefix tells the shell to look for the executable in the current directory.

Passing command‑line arguments

./peak_finder test_array.txt

test_array.txt will be received by your program as an argument.

You can find more posts on my personal blog:

0 views
Back to Blog

Related posts

Read more »

Common problems in Windows

Computer is running slowly - Reboot the computer fixes many issues. - If reboot doesn't help, verify sufficient CPU, disk space, and RAM for the OS, hardware,...

Cloning WSL Distributions

Why clone a WSL distribution? You’ve spent hours setting up a WSL distribution—installing packages, configuring your shell, and tuning your development environ...

Managing WSL Disk Space

Shrinking WSL 2 VHDX Files If you’ve been using WSL 2 for a while, you’ve probably noticed your C: drive slowly losing space 10 GB here, 50 GB there. The culpr...

Solved: Notion not working!!!

Executive Summary Notion appearing offline is often caused by an outdated local DNS cache on your computer, not a service outage. Flushing the DNS cache forces...