How to install or setup a free C and C++ compiler

How to install or setup a free C and C++ compiler

662
9
SHARE

Friends lets begin our first step towards learning C and C++ programming Language with Ccodechamps. Today we are going to teach you how to Install or setup . This is the very first and mandatory step for new programmers, most of them usually face problems in installing an free . This tutorial will give you easy to follow instructions with snapshots, for setting a free compiler to compile C codes and Code blocks, which provide an environment to write code in C and C++ Languages. This tutorial explains you how to install code blocks on Windows XP, Windows Vista or Windows 7.

Steps to Install or setup free C and C++ compiler : Code Blocks

Step 1: Download Code Blocks

To download Code blocks : CLICK HERE

Step 2:  Double click the downloaded exe file to install the Code Blocks.

Step 3: Press Next Button 6 to 7 times until full installation completes. We assume that  you have installed Code Blocks in C:\Program Files\CodeBlocks (the default install location).

Note: You can install anywhere you as per your wish.

Step 4: Launch Code Blocks and Select Default Compiler

While running code blocks you will be see a pop up window showing compilers Auto-Detection Windows.

How to install or setup a free C and C++ compiler

When you get the compiler auto-detection window, just hit OK. Now Code Block will ask, if you want to associate it as the default viewer for C/C++ files, i will suggest just do it.

Now Click on the File menu, and under “New”, select “Project…”

The below Window will open:

How to install or setup a free C and C++ compiler

 

Now Click on “Console Application” and hit the “Go” button.

Then click next until you get to the Language Selection Dialog as shown below:

How to install or setup a free C and C++ compiler

Now you will be asked to select a Language C and C++, if you are not sure then select C++ as using C++ you can use both C and C++. Its up-to you what you want to choose.

After clicking “Next”, Code Blocks will then prompt, where you like to save the console application as shown below:

How to install or setup a free C and C++ compiler

I will recommend you put it in its own folder, as it may create several files (this is especially true if you create other types of projects). You will need to give your project a name, anything will be fine.

Now Clicking “Next” again will prompt you to set up your compiler as shown below:

How to install or setup a free C and C++ compiler

You don’t need to do anything here. Just accept the defaults by hitting “Finish”.

You can now open the main.cpp file on the left as shown below:

How to install or setup a free C and C++ compiler

You may need to expand the contents of the “Sources” folder if you don’t see main.cpp.

At this point, you will have your main.cpp file, which you can modify if you like. For now, it just says “Hello World!”, so we can run it as is. Hit F9, which will first compile it and then run it.

How to install or setup a free C and C++ compiler

You now have a running program! You can simply edit main.cpp and then hit F9 to compile it and run it again.

We hope this guide for setting up C and C++ compiler is helpful to you Guys. If you have any issues ask us in form of comments.

9 COMMENTS

  1. Having read this I believed it was really enlightening. I appreciate you spending some time and effort to put this article together. I once again find myself spending way too much time both reading and leaving comments. But so what, it was still worth it!

  2. sir
    i am new to code block IDE. i have installed it but when i run my first program in main.cpp, id doesnt get compiled. an error saying””HELLO1 – Debug” uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping…
    “HELLO1 – Debug” uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping…
    Nothing to be done.” is coming. what should i do to fix this problem. I really want to use this IDE as soon as possible. Help me plz

LEAVE A REPLY