【筆記】CentOS安裝Code::Blocks

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 foundphp

yum install libtool -y

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

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:app

yum install gamin gamin-devel -y

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

yum install boost boost-devel -y

其餘問題見參考1。ui

3) 其餘

# 安裝gdb
yum install gdb -y

# 創建軟連接
ln -s /opt/codeblocks/bin/codeblocks /usr/bin/codeblocks
# 創建桌面快捷
cd /usr/share/applications
vi codeblocks.desktop
# 寫入內容

codeblocks.desktop:this

[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"spa

ps: 配置,調試,快捷以及Windows上安裝編譯等,參考:Code::Blocks.net

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

控制檯程序運行時,未打印東西,而是報瞭如上信息。調試

yum install xterm -y

4) 參考

  1. Installing Code::Blocks from source on Linux
相關文章
相關標籤/搜索