If the file doesn’t open by itself, double-click it in your downloads folder, then click Install.

3

Select your install preferences and click Continue.

MinGW recommends using the default installation folder (C:\MinGW). If you must change the folder, don’t use a folder with spaces in the name (e.g. “Program Files”).[3]

4

Select which compilers to install.

At the minimum, choose Basic Setup on the left panel, then place check marks next to all of the listed compilers in the right main panel.

More advanced users can choose All Packages and select additional compilers.

5

Click the Installation menu. It’s at the top left corner of MinGW.

6

Click Apply Changes.

7

Click Apply. The compilers will now download and install.

8

Add the path to MinGW to system environment variables. Here’s how:

Press ⊞ Win+S to launch search, then type environment.

Click Edit the system environment variables in the search results.

Click Environment Variables

Click Edit beneath the top box (under “User Variables”)

Scroll to the end of the “Variable Value” box.

Type ;C:\MinGW\bin right after the last letter in the box. Note that if you installed MinGW to a different directory, enter ;C:\path-to-that-directory\bin.

Click OK, and then OK again. Click the one remaining OK button to close the window.

9

Open the command prompt as an administrator. To do this:

Press ⊞ Win+S and type cmd.

Right-click Command Prompt in the search results, then select Run As Administrator.

Click Yes to allow changes.

10

Navigate to the folder where your source code is saved.

For example, if your source code file called helloworld.c is located in C:\Source\Programs, type cd C:\Source\Programs.

11

Type gcc helloworld.c –o helloworld.exe. Replace “helloworld” with the name of your source code and application. Once the program is compiled, you’ll return to the command prompt without errors.[4]

Any coding errors that appear must be corrected before the program will compile.

12

Type the name of your program to run it. If it’s called helloworld.exe, type that to start your program.

You're helping people by reading wikiHow

wikiHow's mission is to help people learn, and we really hope this article helped you. Now you are helping others, just by visiting wikiHow.

World Possible is a nonprofit organization focused on connecting offline learners to the world's knowledge. They work to ensure that anyone can access the best educational resources from the web anytime, anywhere, even if they do not have an internet connection.

Click below to let us know you read this article, and wikiHow will donate to World Possible on your behalf. Thanks for helping us achieve our mission of helping people learn how to do anything.

Theoretically, as long as a file contains the necessary binary machine code, it could be run by a processor. One example is how on Windows, a screensaver is simply a program (just like a .exe) but with the .scr extension. However, as far as I know, most modern operating systems will not attempt to execute a file if it does not identify the file type as being executable, so you would need to somehow trick the operating system into actually starting a new process using the code from the file.