Using GCC natively in Windows


Setting up a GCC Environment

Microsoft Windows

There is a port of GCC available for Windows named MinGW, or Minimalistic GNU for Windows [1]. It functions exactly like the GCC compiler on Linux and is highly recommended for development. Two practical and popular IDE's to use MinGW with are Bloodshed's [2] DevCpp, or [3] Code::Blocks.

Once you have Dev-C++ or C::B installed and running, start a new project and paste the following into the editor window and save as hello.c:

#include <stdio.h>
int main ()
    printf ("Hello, World! Get ready for the GP2X!!\n");
    return 0;

When you hit Compile, GCC will compile your program into a Windows (R) executable for you. Now, open up an MS-DOS Prompt and type the location of the executable then hit enter. The program will print Hello, World! Get ready for the GP2X!! and then exit. If the windows pops up and goes away very quickly, you did not follow directions properly.

If you did everything correctly, congratulations! You're on your way to being a developer!

Personal tools