C programs on Windows 7 with Code::Blocks light weight and open source IDE

Code::Blocks is an open source IDE for C and C++. After trying lot of ways to run C programs on my Windows 7, I found this a better option than DosBox. Because I have experienced problems like mouse couldn’t work properly in some cases then you would have keyboard shortcuts as only option to operate environment. While CodeBlocks has a consistent look with plugin framework.

By means of plugin framework Codeblocks is extensible to great features. In fact it doesn’t come with compiler, debugger and make file features. You can and you have to add them as plugins. So let me start the tutorial.

Step 1

Download latest version of Code::Blocks. It may be 10.05.

Step 2

Install it with all recommended settings.

Step 3

Download latest Compiler and Debugger from TDM-GCC.

Step 4

Install it. Recommended in C drive (or in your system drive). It would be like C:/MinGW or C:/MinGW64 according to version you have downloaded. If your system is 64-bit then download MinGW64 otherwise go for 32 bit package.

Step 5

Here comes main and a little bit tricky part. Now you have Code::Blocks and TDM-GCC  installed on your system, open it up (codeblocks.exe). Follow the given path
Settings (Menubar) > Compiler and Debugger… (Sub Menu) > Toolchain executable (Tab)

In current dialog box set GNU GCC compiler as Select Compiler from the list. Most probably it would already be set by default. Now click on Auto Detect button but if it pop up that “cannot auto detect” or some similar message then add full path of main directory of installation (e.g. C:\MinGW64 in my case.) in ‘Compiler’s Installation Directory’ text box.

Step 6

Now for different features like Compiling, Debugging etc we need to provide their full paths to text boxes under the “Program Files” tab. To browse the given files click on button at right most side and navigate to MinGW or MinGW64 and find proper .exe file. Here I have given setting what I have set for my device.

C compiler : gcc.exe
C++ compiler : g++.exe
Linker for Dynamic libs : g++.exe
Linker for Static libs : ar.exe
Debugger : gdb.exe
Resource Compiler : windres.exe
Make Program : mingw32-make.exe

After setting your Compiler and Debugger programs with Code::Blocks click on OK. You can now write and run programs of C and C++ in Window 7/Vista without any hassle.

Hope you find this article helpful. You may want to subscribe to TheIToons. Like it on Facebook

2 thoughts on “C programs on Windows 7 with Code::Blocks light weight and open source IDE

  1. Nitin Reddy

    CodeBlocks does have a version that you can download with the MinGW compiler. It’s the way I got CodeBlocks running and I recommended it to a couple of other folk who downloaded CodeBlocks without the bundled compiler too.

    I got people to switch from Dev C++ to CodeBlocks only because CodeBlocks can display additional warnings but Dev C++ cant.

    1. Prerak Trivedi Post author

      Thanks Nitin. I didn’t know about that when I installed CB. Ok I’ll include the details of readymade bundle of IDE and MinGW compiler. And Yes I too find it much better than other IDEs or solutions to run C on Windows 7.

      By the way thanks for sharing your knowledge with TheIToons. I love to have you around. :)

      Regards,
      Prerak.

Comments are closed.