2013年7月31日 星期三

Install Code::Blocks 12 on CentOS 6.3

Since CodeBlocks can't be installed from YUM, you'll have to resolve the related dependencies yourself.
Here're my steps:

  1. sudo yum -y gtk2-devel wxBase wxGTK
  2. Download C::B from the official site (http://www.codeblocks.org/downloads/26).
    I downloaded version 12.11. codeblocks-12.11-1.el6.x86_64.tar.bz2
  3. Extract downloaded file:
    tar -jxvf codeblocks-12.11-1.el6.x86_64.tar.bz2
  4. You should get codeblocks-12.11-1.el6.x86_64.rpm from the archive. Install it:
    sudo rpm -i codeblocks-12.11-1.el6.x86_64.rpm
  5. Done!
However, you'll find it annoying when debugging C++ console programs. C::B will call xterm to run you program but you should run gnome-terminal in CentOS. The parameter that should be passed to gnome-terminal is different too.
In C::B, go to Settings->Environment settings->General settings->Terminal to launch console programs, set the value to be
 gnome-terminal --disable-factory --hide-menubar -t $TITLE -x  

You still can't break at break point if you are using GDB under version 7.5. Upgrade to GDB 7.5 or higher to resolve this issue.
I installed GDB 7.6 manually because Yum only has GDB 7.2 now.

  1. Download GDB from http://www.gnu.org/software/gdb/download/
  2. tar xvfz gdb-7.6.tar.gz; cd gdb-7.6; ./configure; make; sudo make install

Done.

沒有留言: