對於剛開始接觸 Linux 開發的人來說,Code::Blocks 常被視為較接近 Visual Studio 使用習慣的 IDE。本文記錄在 CentOS 6.5 上安裝 Code::Blocks 的完整過程。
先取得 root 權限,安裝 gcc 與 g++,再安裝 GTK 2 相關套件。
yum install gcc
yum install gcc-c++
yum install gtk2*
從 SourceForge 下載 wxWidgets 2.8.12 與 Code::Blocks 13.12 原始碼。接著安裝 hunspell、gamin 與 boost 相關套件。
yum install hunspell
yum install hunspell-devel
yum install gamin
yum install gamin-devel
yum install boost
yum install boost-devel
解壓 wxWidgets,進入目錄後執行配置與編譯。
./configure --prefix=/usr --enable-xrc --enable-monolithic --enable-unicode
make
make install
解壓 Code::Blocks,進入安裝目錄,啟用所有 contrib 插件後編譯。
./configure --with-contrib-plugins=all
make
make install
此外,Code::Blocks 需要 xterm 才能正常開啟終端,因此也要安裝 xterm。
yum install xterm
安裝完成後,可在 Application 的 Programming 菜單中找到 Code::Blocks 並啟動。