Lab 1 Installation of C Programming Environment
Lab 1 Installation of C Programming Environment
In this sessional, I will discuss about C compiler and steps to setup C compiler along with
CodeBlocks in your machine.
There are many C compilers available such as GCC C, Borland Turbo C, Visual C, Quick C
etc. In this entire C programming course, we will work with GCC C compiler.
GCC C compiler is reliable, efficient and popular C/C++ compiler among developers. It is open
source and available to download for all most all operating systems. It is pre-installed C compiler
in all UNIX based operating systems.
In this entire C programming course, we will use CodeBlocks IDE to create, compile, debug and
execute C programs. However, there are many other IDE's for developing C projects such as
Netbeans, Eclipse, DevC++, Microsoft Visual Studio Code etc.
1.2.1 Download and install CodeBlocks with C compiler in
Windows
CodeBlocks is available in two variant - with and without compiler. For Windows it comes with
MinGW C compiler suite. MinGW C compiler is a windows variant of GCC C compiler.
Download the latest build of CodeBlocks with C compiler from its official website.
Note: You must download the CodeBlocks with MinGW setup executable file.
The download size is about 80MB, which hardly takes 1-2 minutes on good internet connection.
After downloading, run the installer. Installation is simple next...next stuff. The installation
wizard will guide you throughout the installation processes.
On first run CodeBlocks requires few things to gear up. So let us first configure CodeBlocks.
4. Sometimes you will encounter problems running the compiler and debugger with
CodeBlocks. To resolve the issue follow the instructions.
2. From the New form template window select C/C++ source and click Go button.
3. If you see a welcome message, click next to skip the welcome message. Make sure you have
checked Skip this next time checkbox if you do not want to see this welcome message again.
Next, select your language from C/C++ source window and click Next button.
4. Give name to your file and specify the location.
Once you created a C workspace, click the ellipsis button present under File name with full
path. Browse your C workspace; mention the file name click Finish.
5. Write and save your first C program. Press Ctrl + S to save.
To compile and run a C program, click Build → Build and run to compile and build your C
program, alternatively use the shortcut key F9.
In case, your program contains any errors. Error messages are shown in the Build messages tab
below the code editor.
If your program runs successfully, then the following output window will appear showing the
message “Hello World”.
Exercise:
.. see
………I
… … … remember!