jump to navigation

Code::Blocks, a good C/C++ IDE for Linux October 2, 2008

Posted by razasayed in programming.
Tags: ,
trackback

Just some time back my brother who was using a Linux machine, asked me how he could do C/C++ development on that platform . Most colleges here in Mumbai teach students how to use the Borlands Turbo C++ IDE, a.k.a TC which i think by now is pretty outdated and can well be classified as an antique piece of software . Also, its a Windows only program , and when it comes to C/C++ programming on “Windows” most students never look beyond “toy” programs like prime numbers, factorial, matrix operations etc and use Microsoft Visual Studio for doing GUI stuff.

I think Linux is a good platform for budding C/C++ developers to hack on , where C/C++ are still the main “programming” languages used by developers , in addition to “scripting” languages like Python , PHP etc..

While there are numerous alternatives for C/C++ programming on Linux as far as IDE’s are concerned , for example, Eclipse , Anjuta , KDevelop etc, Code::Blocks according to me appears to be a really easy to use and lightweight IDE . Also just like Eclipse, Code::Blocks is also plugin based, and supports a lot of cool features we expect out of IDE’s like integrated debugger ,syntax highlighting, code completion , class browsers etc..

To install Code::Blocks on my bros machine running Ubuntu i performed the following procedure :

Step 1) Code:Blocks requires the wxWidgets , a cross-platform C++ GUI toolkit to be installed, so first install that by issuing the following command at the terminal :


sudo apt-get install libwxgtk2.8-0

Step 2) Download the Code::Blocks binary for Ubuntu from http://www.codeblocks.org/downloads/binaries

Step 3) Unzip the archive. Now , you will get a set of deb files.

Step 4) Finally, run the following command to install :


sudo dpkg -i *.deb

Thats it . You should now see the icon for Code::Blocks in your Programming Menu.

Note : I was facing some issues while trying to build gtk+ programs in Code::Blocks v8.02 , inspite of having the libgtk1.2-dev package installed .  However, the problems were resolved once i installed the libgtk2.0-dev package .

Happy Hacking ! 🙂

Advertisements

Comments»

1. Kova - October 18, 2008

this is the best tutorial how to install Code::Blocks on the internet
thanks dude 🙂

2. razasayed - October 18, 2008

Hi Kova, glad u liked the post 🙂

3. Mehrdad - November 17, 2009

Dear razasayad.

I don’t know how much experience do you have in code blocks IDE but I ask my question if possible please assist me in this issue.
I installed CodeBlocks on Ubuntu Linux. I select GNU GCC as compiler for it. It works well and I can compile many simple Projects in it, But I have a big serious problem.
I’m using some C++ source files that they are completely out of project and headers declare some function in it and source files consist the body of those functions.
In setting Menu/Compiler and Debuger… I select inc and src directory of that file for search directory of compiler, Linker and resource files but Codeblocks can’t find the body of functions and at the middle of comiling it will be paused with message below:
-undefined reference to ”.
I don’t know how we can solve this problem? If you know a way please help us.

Regards.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: