CodeBlock 是一套用來編寫C/C++的整合型IDE,功能強大

但Ubuntu 10.04內建的套件本版本是8.04,要安裝10.04版 方法如下

1.安裝compiler

sudo apt-get install build-essential

2.安裝debugger

sudo apt-get install gdb
You'll need to install wxWidgets to use Codeblocks. Revisions prior to revision 4051 use wxWidgets 2.6 and revisions from 4051 and after use wxWidgets 2.8.4. If you want to install a revision prior to revision 4051, make sure you have your universe and multiverse repositories enabled and install the following packages.
3. Install wxWidgets library. (This package is all that is needed to run any application that uses wxWidgets. ie. Code::Blocks)
sudo apt-get install libwxgtk2.6-0
4. Install the wxWidgets developement packages. (This is used to develop wxWidgets applications of your own.)

sudo apt-get install libwxgtk2.6-dev wx2.6-headers wx-common

P.S.step3 跟step 4 非常重要 ,若缺了gtklib後面的deb安裝包就會安裝失敗!

5. (OPTIONAL) Install the wxWidgets documentation.

sudo apt-get install wx2.6-doc
P.S.上面的步驟就是完成libgtk函式庫和exWidgets相關函式庫的安裝.
To install wxWidgets 2.8.4 you need to be using Ubuntu 6.10 (Edgy Eft) or Ubuntu 7.04 (Feisty Fawn) and you need to add the wxWidget repository to your sources.list. You can install wxWidgets 2.8.4 on Ubuntu 6.06 (Dapper Drake), but the nightly builds are not made to run on Dapper.

1. Backup your current sources.list first for precaution.

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2. Open your sources.list in a text editor to edit it.

gksudo gedit /etc/apt/sources.list
3. Add the correct repository for the Ubuntu version you are running to the end of the file. The repository listed below is referenced on the wxWidgets.org download page and appears to be for the stable version.

deb http://apt.tt-solutions.com/ubuntu/ edgy main
or
deb http://apt.tt-solutions.com/ubuntu/ feisty main

4. Save and close the file.
5. Add the key for tt-solutions.com.

sudo wget http://www.tt-solutions.com/vz/key.asc

sudo apt-key add key.asc
Alternate wxWidgets repository. Some users of Code::Blocks have received critical errors related to libwxgtk when using the above repository packages. They were able to solve their problems by installing newer packages available from an alternate repository from wxWidgets.org. To use these packages make the following changes to the above directions:

Add 
deb http://apt.wxwidgets.org/ edgy-wx main 
or 
deb http://apt.wxwidgets.org/ feisty-wx main 
to your sources.list.

Download the gpg key using 
wget http://apt.wxwidgets.org/key.asc 
and install the same as above.
P.S.這邊下載的gpg key 會存在預設瀏覽器下載的存放位置,而由於剛剛有下載過一個key,
gpg key 會存成另外一個檔案
所以在執行add key 時,要改一下檔名,(檔名請參考下載存放位置裡面顯示的名稱,我的例子是顯示ley.asc.1)
sudo apt-key add key.asc.1
6. Update your sources.list and run upgrade to make sure everything is up-to-date.
sudo apt-get update
sudo apt-get dist-upgrade
7. Now you're finally ready to install wxWidgets 2.8.4.

sudo apt-get install libwxgtk2.8-0 libwxgtk2.8-dev wx2.8-headers wx-common

8. Set wxWidgets 2.8 as default version for your machine. Select number for the wxgtk2.8 version.

sudo update-alternatives --config wx-config

Now go get the nightly build and install it. All dependencies should now be met.

1. Get the latest nigtly build of Code::Blocks from the nightly builds forum.

2. Install Code::Blocks.
codeblock下載區下載codeblock 安裝檔-->codeblocks-10.05-1-debian-i386.tar.bz2
接著使用tar xvjf解開這個壓縮包之後安裝所有的.deb檔
sudo dpkg -i *.deb
大功告成!


reference website
http://zhidao.baidu.com/question/159569801.html?push=related

arrow
arrow
    全站熱搜

    Kimi 發表在 痞客邦 留言(0) 人氣()