Protec Computer Academy (An ISO 9001:2015 Certified Institute, Powered by E-Max Education, Branch Code EMAX/EK-80503, Registered by government of India.) is a best IT training center in Siwan with 100% Job placement assistance. Where you can learn Programming, WebDesigning, Hardware|Networking, Blogging, WordPress, Digitial marketing, English Speaking, And many more...| All certificates are valid in Government Jobs as well as in Private Companies. *** At Tara Market, Beside Vishal Mega Mart - Siwan*** +917541905230, Email- ahmad.irshad781@gmail.com *** Follow us on | | @welcome2protec

Monday, November 9, 2020

How to download, Install and Configure CodeBlocks IDE?

Downloading, Installing and configuring CodeBlcoks IDE : which is used to create, edit, compile, debug and execute C/C++ programs in single place.

CodeBlocks | welcome2protec

In this entire series of C programming tutorial. You will create, edit, compile and execute many C programs. Before we begin to learn about C programs, you must configure your computer with C compiler.


To create and execute a C program you require minimum two softwares.

  1. A text editor (such as Notepad, Notepad++, Gedit, TextEdit, Sublime etc.)
  2. A C compiler (Optionally CodeBlocks IDE).

Text editor: is a software program that enable you to write and edit your programs.

A compiler: translate your program into a series of binary number (0s and 1s) which coputer understands. So whenever you compile a program, the compiler creates a new binary file called executable file which computer can execute.

There are many C compilers available such as GCC C, Borland Turbo C, Visual C, Quick C etc. In this entire series of C tutorial, I 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.


Why use a CodeBlocks IDE?

CodeBlocks is an IDE (Integrated Development Environment) used to create, edit, compile, debug and execute C/C++ programs in single place. It is very powerful IDE for developing C projects. CodeBlocks comes with a compiler called GCC to compile C and C++ programs.

In this entire series of C tutorial, I 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.


Installing CodeBlocks 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.

CodeBlocks | welcome2protec

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.


Configuring CodeBlocks and GCC C compiler:

On first run CodeBlocks requires few things to gear up. So let us first configure CodeBlocks.

1) Associate CodeBlocks with C compiler. CodeBlocks automatically detects our installed C compiler. Set the detected compiler as default and click OK button.

CodeBlocks | welcome2protec

2) Associate C/C++ files with CodeBlocks IDE. Make sure all C/C++ files opens in CodeBlocks by default.

CodeBlocks | welcome2protec


3) Set an idle perspective to use CodeBlocks for beginner.

CodeBlocks | welcome2protec


However, if you want to compile programs from command line with various gcc options, then set environment variables for C compiler in Windows (in Linux no need).

1) Hit Win + R to open run command window. Type systempropertiesadvanced or c:\windows\system32\systempropertiesadvanced. Click OK or hit enter to open advanced system settings dialog.

CodeBlocks | welcome2protec


2) Inside advanced system properties, click Environment Variables. Alternatively, hit n to open Environment Variables settings.

CodeBlocks | welcome2protec


3) In the Environment Variables window, move down to System variables. Inside the system variables list, find path variable. Select the Path variable and click on Edit, alternatively hit Alt + I to open Environment Variable editor window.

CodeBlocks | welcome2protec

4) Inside the environment variables editor window. We need to add a new entry to the Path environment variable. To add a new environment variable entry, click New then click Browse. This will open a file browser.

CodeBlcoks | welcome2protec


5) Go to your CodeBlocks installation folder, inside that browse for MinGW\bin folder. In my case CodeBlocks bin folder is located under C:\Program Files (x86)\CodeBlocks\MinGW\bin. Select bin folder and click OK.

CodeBlcoks | welcome2protec

Remaining is just OK...OK process. Click OK on every window you opened to save all configurations.


Verifying GCC C compiler installation and configuration:

To verify the above steps. Open command prompt on windows via any of these methods.

  • Open run command window by pressing Win + R. Inside run type cmd and hit enter.
  • Alternatively, hit Win + S to search, type cmd and hit enter.
  • The easiest one, press Win + X (on win 8 and later versions), then hit C to open command prompt.

In command prompt window type gcc --version and hit enter. This will show the version information of GCC compiler. On my machine, it shows following output.

gcc (tdm-1) 4.9.2
Copyright (C) 2014 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.

If gcc --version results in any error, then go back to the configuration step and configure it properly.










Protec Computer Academy (An ISO 9001:2015 Certified Institute, Powered by E-Max Education, Branch Code EMAX/EK-80503, Registered by government of India.) is a best IT training center in Siwan with 100% Job placement assistance. Where you can learn Programming, WebDesigning, Hardware|Networking, Blogging, WordPress, Digitial marketing, English Speaking, And many more...| All certificates are valid in Government Jobs as well as in Private Companies. *** At Tara Market, Beside Vishal Mega Mart - Siwan*** +966532621401, Email- ahmad.irshad781@gmail.com *** Follow us on | | @welcome2protec

Help others by sharing this page.

Ahmad Irshad

Author & Editor

I love blogging, teaching, learning computer science and sharing it to others. I've written and develped this site so that students may learn computer science related tutorials eaisly. MCA / MCITP

0 Comments:

Post a Comment

Please don't enter any spam link in the comment box.


Protec Computer Academy (An ISO 9001:2015 Certified Institute, Powered by E-Max Education, Branch Code EMAX/EK-80503, Registered by government of India.) is a best IT training center in Siwan with 100% Job placement assistance. Where you can learn Programming, WebDesigning, Hardware|Networking, Blogging, WordPress, Digitial marketing, English Speaking, And many more...| All certificates are valid in Government Jobs as well as in Private Companies. *** At Tara Market, Beside Vishal Mega Mart - Siwan*** +966532621401, Email- ahmad.irshad781@gmail.com *** Follow us on | | @welcome2protec
Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec Protec
Contact Us