Recommended Setup for C Programming on Windows 10
This walkthrough shows how to setup a c programming toolchain. For writing source it will use Atom text editor. Programs will be run on the Windows PowerShell, which is built into Windows 10 and 11. Code will be compiled using the MinGW c compiler also access through the Powershell as a gcc
command similar to the way a Linux bash terminal would be used.
1. Install MinGW C Compiler
- Download the installer for MinGW below:
- Run the installer setup program. Select the Install button on the first screen.
- Check the installation directory: set it as C:\MinGW
if it is not already. Optionally, you can uncheck the box for the desktop shortcut to MinGW Manager (you can always find it in the start menu later). Select Continue.

- The installer will download some files, select Continue once the download progress reaches 100%.
- The MingGW Installation Manager window will open. Right Click on mingw32-base and select Mark for Installation as shown below.

- In the upper right click Installation → Apply Changes. Another window will appear. Select the Apply button.

- The installer should download some more files. It is finished when you see "All changes were applied successfully". Click the Close button. Now close the MinGW Installation Manager.
2. Add Path Environment Variable for GCC
- Open the windows Start Menu and type environment
in the search bar.
- Within the search results, select Edit environment variables for your account under settings as shown below.

- An Environment Variables window should launch that contains two list boxes. In the top box titled User Variables select the Path entry and the Edit... button.

- An Edit environment variablee window should launch. Select the New button and type the location for the MinGWbinary directory. It should be C:\MinGW\bin
if part 1 was done correctly.

- Close all windows. Now you can check if GCC works on the PowerShell.
- Open the windows Start Menu and type powershell
in the search bar. Select the Windows PowerShell
- Type gcc --version
into the Windows PowerShell and hit Enter. If MinGW is setup correctly, you should see a print-out like the one shown below.

3. Install Atom Editor
- Download and run the installer for Atom Code Editor below:
4. Setup C Projects Directory
- Open the windows Start Menu and type file explorer
in the search bar. Select the File Explorer.
- In the left vertical navigation bar open This PC and select Local Disk and then the Users directory.

- Double click the directory with your user name inside Users.
- Create a new folder called cProjects
inside your user directory.

- Launch Atom editor (you can use the start menu search). You can close all the 'welcome' tabs. Add the new folder with the Add folders button, or by selecting File → Open Folder in the upper left (if it is not visible, press alt on your keyboard).

- Click on the address bar and type C:\Users\<your-username>\cProjects
with your user name substituted. Click the Select Folder button.

5. Test ToolChain With Hello World Project
- Launch Atom editor if it is not open. Right Click the cProjects folder and select New Folder. Name it hello-world
.

- Now Right Click the hello-world folder and select New File. Name it hello-world/main.c
.

- Copy the following into main.c.
main.c
#include <stdio.h>
int main(){
puts("hello world!");
return 0;
}
- Save the file with ctrl + s or File → Save. Your Atom window should now look similar to the one shown below.

- Open PowerShell and enter the following commands:
cd cProjects
(change directory into your cProjects folder)
cd hello-world
(change directory into your the folder for hello world)
gcc -o run main.c
(create an executable program named 'run' by compiling main.c)
./run
(execute program 'run' inside this directory)
- If "hello world!" prints, your tool chain is setup correctly.
