1.安装gcc、g++
yum install gcc
yum install gcc-c++
2.安装gtk2-devel
yum install gtk2*
3.安装wxGTK(或者wxwidgets),下载地址:http://www.wxwidgets.org/downloads/,
下载的文件为:wxWidgets-3.0.2.tar.bz2
解压
bunzip2 wxWidgets-3.0.2.tar.bz2
tar -xvf wxWidgets-3.0.2.tar
进入目录,执行如下
cd wxWidgets-3.0.2/
./configure --prefix=/usr --enable-xrc--enable-monolithic --enable-unicode
Make
make install
4.安装codeblocks,下载codeblocks安装包,下载地址:http://www.codeblocks.org/downloads/
解压,进入目录
bunzip2 codeblocks-16.01.el5.i386.tar.bz2
tar -xvf codeblocks-16.01.el5.i386.tar
执行命令
yum install hunspell*
yum install gamin*
yum install boost boost-devel
然后make时可能出现以下错误:
[root@localhost codeblocks-16.01.release]#make
CDPATH="${ZSH_VERSION+.}:"&& cd . && /bin/sh/home/yx/devel/codeblocks-16.01.release/missing aclocal-1.13 -I m4
/home/yx/devel/codeblocks-16.01.release/missing:行81:
aclocal-1.13:未找到命令
WARNING: 'aclocal-1.13' is missing on yoursystem.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
make: *** [aclocal.m4]错误127
解决方法:
yum -y install automake-1.13.4-3.el7.noarch
./configure --prefix=/usr
--with-contrib-plugins=all
建立软链接
ln -s /codeblocks/bin/codeblocks/usr/bin/codeblocks
建立桌面快捷,输入下图代码
vi /usr/share/applications/codeblocks.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Code::Blocks IDE
GenericName=Integrated developmentenvironment
Comment=Configurable and extensible IDE
Exec=/codeblocks/bin/codeblocks %F
Icon=codeblocks
Terminal=false
X-MultipleArgs=false
Categories=Development;IDE;GTK;
StartupNotify=true
MimeType=application/x-codeblocks;application/x-codeblocks-workspace;
4.安装一下xterm:yum install xterm
然后点击应用程序->编程->Code::Blocks IDE,安装成功