Linux–Swig 安裝(cloud9)

step1:下載原始碼

http://www.swig.org/survey.html

填個問券 就可以下載了  主要是在調查 您即將要把swig 用在哪種語言上

 

step2:安裝 g++

sudo apt-get install g++

 

step3:安裝pcre

sudo apt-get install libpcre3 libpcre3-dev

 

step4: 解壓縮原碼

tar -xzvf swig-3.0.8.tar.gz

 

step5: 編譯

cd 到剛剛解壓的目錄中

./configure –prefix=/home/mark/developer/swigtool      % 指定安裝目錄

make                                                                                    % 編譯

make install                                                                         % 安裝

 

step6:配置環境

如果沒用過vim 編輯器的可以參考鳥哥的解說:

http://linux.vbird.org/linux_basic/0310vi.php#vi_vim_why

 

sudo vim /etc/profile   然後按方向鍵往下拉 因為我們要編輯 這裡打  E

 

往下拉到最後

 

在鍵盤上按  i    下面會出現 Insert   即可進入編輯模式

然後在文件最後加此兩行

PATH=$PATH:/home/mark/developer/swigtool/bin
export PATH

 

輸入完畢按 Esc 跳出編輯模式 然後輸入  :wq  代表存檔 結束



 

關閉文件 執行以下命令讓環境立刻生效

這樣在其他路徑下 也可以執行 swig

source /etc/profile

 

成功啦~~~灑花~~

 

參考資料:

http://blog.csdn.net/veryitman/article/details/17398151

http://linux.vbird.org/linux_basic/0310vi.php

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments