使用源碼包安裝codeblocks
一、登錄http://www.codeblocks.org/home進入codeblocks官網
點擊Download進入下載界面
如圖所示選擇源碼安裝
選擇第一個進入下載用進入SourceForge(全球最大開源軟件開發平臺和倉庫)下載。
對源碼包進行解壓。
tar -zxvf codeblocks_13.12-1.tar.gz解壓到當前文件夾下
cd codeblocks進入文件夾
如圖所示:使用Vim README打開後如圖所示
打開COMPLIERS後看見如下信息
大概是說Linux下安裝要依賴GCC和GDB,如果沒有安裝的要記着把GCC安裝好
使用./configure檢測依賴問題,如圖所示提示錯誤wx-config沒安裝
安裝上wxwindows
zsheng@ubuntu:~/codeblocks-13.12$ wx-config
The program 'wx-config' can be found in the following packages:
* libwxbase2.8-dbg
* libwxbase2.8-dev
* libwxgtk2.8-dbg
* libwxgtk2.8-dev
Try: sudo apt-get install <selected package>
按照它要求的做
zsheng@ubuntu:~/codeblocks-13.12$ sudo apt-get install libwxbase2.8-dbg \
> libwxbase2.8-dev libwxgtk2.8-dbg libwxgtk2.8-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libwxbase2.8-0 libwxgtk2.8-0 wx-common wx2.8-headers
Suggested packages:
wx2.8-doc libgl1-mesa-dev libgl-dev xlibmesa-glu-dev libglu-dev
The following NEW packages will be installed:
libwxbase2.8-0 libwxbase2.8-dbg libwxbase2.8-dev libwxgtk2.8-0
libwxgtk2.8-dbg libwxgtk2.8-dev wx-common wx2.8-headers
0 upgraded, 8 newly installed, 0 to remove and 316 not upgraded.
Need to get 50.1 MB of archives.
After this operation, 129 MB of additional disk space will be used.
Do you want to continue [Y/n]?
我們點擊回車以繼續下載安裝
在下載完成後一些安裝程序安裝完成後,我們繼續
在此運行./configure提示還有沒安裝
No package 'gtk+-2.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables GTK2_CFLAGS
and GTK2_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
zsheng@ubuntu:~/codeblocks-13.12$
繼續安裝這個sudo apt-get install gtk+-2.0之後又是漫長下載安裝和等待。
一段時間的等待之後,終於是安裝好了,接下來繼續檢測依賴問題
*************************************************
* Code::Blocks source tree has been configured. *
*************************************************
You can now build Code::Blocks by issuing 'make'.
When the build is complete, become root and install
it by issuing 'make install'.
這下終於搞定依賴問題了。
./configure --prefix=/usr/local/codeblocks
將之安裝在/usr/local/codeblocks之下
接下來sudo make && make install
接下來就是編譯和安裝了又是漫長的等待
沒有提示錯誤,這下安裝好了。
進去開啓試試:
zsheng@ubuntu:/usr/local/codeblocks/bin$ ./codeblocks
如下安裝好了,哈哈,就此完成。