Tuesday, October 9, 2012

Installing the Code::Blocks IDE on CentOS / Redhat



Install the following packages before starting:
zip
make
gettext
autoconf
automake
libtool
m4
intltool
gcc-c++
libstdc++-devel

In CentOS, you might do this with:
su -c 'yum groupinstall "Development Tools"'
su -c 'yum install intltool'

OR here is an alternate command you can copy/paste to get it done:

yum –ty install zip make gettext autoconf automake libtool m4 intltool gcc-c++ libstdc++-devel

Gather the installation files:
codeblocks-10.05-src.tar.bz2
wxWidgets-2.8.11.tar.gz
Extract and place folders in /usr/local/src

cd /usr/local/src
tar xvzf ~/wxWidgets-2.8.11.tar.gz
tar xvjf ~/codeblocks-10.05-src.tar.bz2

Install wxWidegets
cd /usr/local/src/wxWidgets-2.8.11/
./configure --prefix=/opt/wx/2.8
make
make install

Add the path to the system path
vi /etc/profile
before the export statement append to the end of the path so it looks like this:
PATH=$PATH:/opt/wx/2.8/bin
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
Add the following line to /etc/ld.so.conf
/opt/wx/2.8/lib

Reload the profile configuration with the new path info
ldconfig
source /etc/profile

Install Code Blocks
cd /usr/local/src/codeblocks-10.05-release
./configure
make
make install

At this point a reboot would be good

Run codeblocks
In an x terminal session type the command to start code Blocks
codeblocks

5 comments:

  1. Or if you are lazy (like me)

    Install Howto
    Download the latest epel-release rpm from (latest release was: epel-release-6-8.noarch.rpm on 4/4/2014)
    http://dl.fedoraproject.org/pub/epel/6/x86_64/

    Install epel-release rpm:
    # rpm -Uvh epel-release*rpm

    Install codeblocks rpm package:
    # yum install codeblocks

    Simple. =D

    ReplyDelete
    Replies
    1. Oops, you need to do a:

      yum install xterm

      You might be able to change this, but I found it easier to just install xterm which is what CodeBlocks wants to run your console programs with

      Delete
    2. Amazing! Thanks :D

      Delete
  2. Also had to: yum install gtk2-devel

    ReplyDelete
  3. Thanks Anonymous!!!

    ReplyDelete

Let us know if you found anything helpful, or have an even better solution. Thanks for your participation in the discussion.