Install GCC compiler
You need to install three basic utility programs for the basics of course work.
7zip
This is a compression program to zip and unzip files. It can be downloaded from the 7zip site. After installing the 7-Zip, add the directory of 7-Zip, C:Files\7-Zip to your user’s environment Path variable.
Notepad++
This is a simple text editor, which can be used to read and write C source code programs. It can be downloaded from the Notepad++ site. For the convenience of starting notepad++ by command line, you need adding the directory of notepad++ (e.g., C:\Program Files (x86)\Notepad++
) to your user’s environment Path variable.
Visual Studio Code
Visual Studio Code is light and popular programming IDE, can be used to write assignment programs (recommended). You can install C/C++ IntelliSense, debugging and code browsing extension and Cod Runner extension for C/C++ programming.
Install GNU GCC compiler
We will use GNU C compiler GCC for class code examples, labs and assignments. GCC is available for Windows, Linux, macOS, and many other platforms as well. Specifically, we will use Windows OS and the MinGW (Minimalist GNU for Windows) C compiler.
If you use Windows, you can set up this development environment on your computer by downloading this software package (cp264_software.zip). Save or move cp264_software.zip to the C folder.
Unzip cp264_software.zip to the C folder. You can do this by right clicking the cp264_software.zip > 7-zip (assume 7zip is installed) > Extract here. Note that for Windows 11, you can find 7-Zip from Show more options.
It is important to see the file name extension for the programming. In order to see file name extension, you can click the view menu of file explore > Check the File name extensions.

If you install the MinGW in folder C:/cp264/
, make sure to add C:/cp264/MinGW/bin
and C:/cp264/MinGW/msys/1.0/bin
to user’s environment Path variable.
This can be done by typing “env” the search box, selecting “Edit environment variables for your account”, selecting “Path” if exits otherwise create the Path variable as shown in Figure 1, adding the above two paths as Figure 2.


Click OK to close the Edit Environment Variable and Environment Variable panels.
Open a command console (also called command prompt. terminal), e.g., type cmd
in the search input box at the start button, and hit the enter key.
In the command console, type and run the following command.
gcc --version
The output is like the following (compiler dependent):
gcc (MinGW.org GCC-6.3.0-1) 6.3.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You can also type and run the following command to see the directory of gcc.ext file
where gcc.exe
Test GCC compiler
- Create a example directory, say
C:/cp264/example
- Open a command console, type and run command:
cd C:/cp264/example
- Create as C program named
hello.c
by command:notepad++ hello.c
assuming notepad++ is installed and path is added.
Save and compile hello.c
4. Compile hello.c
by command: gcc hello.c -o hello
This will create executable program file hello.exe
6. Run the program by typing command: hello
Notice: If you use Linux or MacOS, you can use nano, vi, emacs or other text editors to write source code programs. For example, command nano hello.c
will open the nano editor for file hello.c, and command gcc hello.c -o hello
will create an executable program hello
. Run the program by command ./hello
Using Eclipse IDE
Even though there is no need to use advanced IDE to write C source code, it is a good practice to try out some IDEs for complex C programming projects. The cp264_software package contains Eclipse IDE for C/C++ under eclipse folder.
Click to run C:/cp264/eclipse/eclipse.exe`
Creating C project on Eclipse
Creating Eclipse C project
- Start Eclipse, create a new workspace say C:/cp264/workspace
- Create a new C project: File -> New -> C project, name the project as hello. In the Executable drop-down, select Hell World ANSI C project. In Toolchains, select MinGM GCC. Click the finish button.


- Compile by clicking the hammer button, and run by clicking the Run button. The output will be shown in the Console tab.

- Alternatively, compile buy right clicking the project hello in the Project Explorer -> Build project, and run by right clicking the project hello -> Run As -> Local C/C++ Application.

- The source code program is
hello.c
under the src folder. Open hello.c by clicking it.
Use Eclipse to develop external programs
- Delete hello.c in the src folder.
- Drag the ’C:/cp264/example/hello.c` to the src folder of the hello project, select “Link to files” as Figure 7.

- Modify hello.c by adding line
printf("hello, Eclipse\n");
, save hello.c. You will see the changes of ’C:/cp264/example/hello.c`. - Compile and run. You will see the same output in the Eclipse console.
- Delete the hello.c from Eclipse. The deletion only removes the link, and won’t delete actual file ’C:/cp264/example/hello.c`.
This method allows you to use a common Eclipse project setting to develop different lab/assignment programs in the course work directories.