您的位置:首页 > 运维架构 > Linux

【笔记】CentOS安装Code::Blocks

2014-03-21 23:08 585 查看

CentOS安装Code::Blocks

1) 前提

# 检查GTK版本,至少2.0
yum list installed *gtk*  # 或下行命令
# ll /usr/lib/ | grep gtk  # 有类似"libgtk-x11-2.0.so"否

# 安装wxGTK
# yum list wxGTK*  # 查看
yum install wxGTK.i686 wxGTK-devel.i686 -y
# 源码安装见参考1

# 安装SVN
yum install subversion -y
svn help  # 查看帮助

2) 安装

cd /opt/Backup/
# SVN获取C::B源码
svn co svn://svn.code.sf.net/p/codeblocks/code/trunk codeblocks

cd codeblocks/
# 设置配置脚本及依赖,只需运行一次。可能会遇到"Issue 1"
./bootstrap
# 配置时指定目录并安装插件。可能会遇到"Issue 234"
./configure \
--prefix=/opt/codeblocks \
--with-contrib-plugins=all
# 编译
make
# 安装
make install

cd /opt/codeblocks/bin/
./codeblocks &

Issue 1: ./bootstrap: line 66: libtoolize: command not found

yum install libtool -y

Issue 2: checking for HUNSPELL... configure: error: Package requirements (hunspell) were not met:

yum install hunspell -y
# However: Package hunspell-1.2.8-16.el6.i686 already installed and latest version
# yum list installed hunspell*,已经安装有了。
yum install hunspell-devel -y

Issue 3: checking for GAMIN... configure: error: Package requirements (gamin) were not met:

yum install gamin gamin-devel -y

Issue 4: configure: error: needed boost headers not found or not usable

yum install boost boost-devel -y

其他问题见参考1。

3) 其他

# 安装gdb
yum install gdb -y

# 建立软链接
ln -s /opt/codeblocks/bin/codeblocks /usr/bin/codeblocks
# 建立桌面快捷
cd /usr/share/applications
vi codeblocks.desktop
# 写入内容

codeblocks.desktop:

[Desktop Entry]
Version=1.0
Type=Application
Name=Code::Blocks
GenericName=IDE
Comment=The open source, cross platform, free C, C++ and Fortran IDE
Exec=/opt/codeblocks/bin/codeblocks %F
Terminal=false
MimeType=application/x-codeblocks;application/x-codeblocks-workspace;
Icon=/opt/codeblocks/share/codeblocks/icons/app_64.xpm
Categories=IDE;Development;
StartupNotify=true

然后,于"Applications > Programming > Code::Blocks"右键"Add this launcher to desktop"

ps: 配置,调试,快捷以及Windows上安装编译等,参考:Code::Blocks

Issue 1: Process terminated with status 255 (0 minute(s), 0 second(s))

控制台程序运行时,未打印东西,而是报了如上信息。

yum install xterm -y

4) 参考

Installing Code::Blocks from source on Linux
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息