ubuntu10.04默認安裝gcc編譯器是4.4版本
sourcenav-6.0.tar.gz是Linux下的源代碼查看器的源代碼文件。經過下載sourcenav-6.0.tar.gz來進行安裝。
下載地址:
http://nchc.dl.sourceforge.net/project/sourcenav/sourcenav/6.0/sourcenav-6.0.tar.gzubuntu
在Linux下從源文件安裝程序時,有一個通用模式,即配置(./configure)–> 編譯(make) –>安裝.
編譯sourcenav-6.0系統默認的gcc4.4編譯通不過,須要安裝gcc4.0如下版本。ubuntu環境下不一樣gcc版本能夠共存,不須要卸載gcc高版本。.net
一、從新安裝低版本gcc
我安裝的版本是gcc3.4版本
1)安裝gcc3.4版本
sudo apt-get install gcc-3.4
2)將將gcc3.4缺省gcc
先查看一下ubuntu是否存在兩個版本
ls /usr/bin/gcc* -ll
將gcc3.4缺省gcc
ln -sf /usr/bin/gcc-3.4 /usr/bin/gcc
編譯sourcenav完成後,在將gcc4.4設爲缺省gccorm
二、sourcenav編譯和安裝
1)安裝必要組件
sudo apt-get install libx11-dev
1)解壓文件
tar -xzvf sourcenav-6.0.tar.gz
解壓後在當前目錄下會生成sourcenav-6.0目錄,而後進入該目錄
cd sourcenav-6.0
2)configure 一些選項, 好比安裝目標路徑
sudo mkdir /usr/share/sourcenav
5. 執行./configure --prefix=/usr/share/sourcenavigator.
將該軟件全部的文件都被複制到這個目錄
不指定prefix,可執行文件默認放在/usr /local/bin,庫文件默認放在/usr/local/lib,配置文件默認放在/usr/local/etc。
其它的資源文件放在/usr /local/share。要卸載這個程序,要麼在原來的make目錄下用一次make uninstall(前提是make文件指定過uninstall),
要麼去上述目錄裏面把相關的文件一個個手工刪掉。
3)編譯
make
4)安裝
make install blog
三、啓動SourceNavigator出錯問題
cd /usr/share/sourcenavigator
./snavigator
啓動sourcenavigator時,出現以下問題
Can't find a usable tk.tcl in the following directories:
/usr/local/share/tk8.3
/usr/local/share/tk8.3/tk.tcl: no event type or button # or keysym
no event type or button # or keysym
while executing
"bind Listbox {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
(file "/usr/local/share/tk8.3/listbox.tcl" line 182)
invoked from within
"source [file join $tk_library listbox.tcl]"
invoked from within
"if {[string compare $tcl_platform(platform) "macintosh"] && \
[string compare {} $tk_library]} {
source [file join $tk_library button.tcl]
so..."
(file "/usr/local/share/tk8.3/tk.tcl" line 308)
invoked from within
"source /usr/local/share/tk8.3/tk.tcl"
("uplevel" body line 1)
invoked from within
"uplevel \#0 [list source $file]"
This probably means that tk wasn't installed properly.ci
注意上面的第10行:file 「/usr/local/share/tk8.3/listbox.tcl」 line 182
$sudo gedit /usr/local/share/tk8.3/listbox.tcl
打開listbox.tcl文件,註釋掉182~184三行。資源
Can't find a usable tk.tcl in the following directories:
/usr/local/share/tk8.3
/usr/local/share/tk8.3/tk.tcl: no event type or button # or keysym
no event type or button # or keysym
while executing
"bind Text {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
(file "/usr/local/share/tk8.3/text.tcl" line 457)
invoked from within
"source [file join $tk_library text.tcl]"
invoked from within
"if {[string compare $tcl_platform(platform) "macintosh"] && \
[string compare {} $tk_library]} {
source [file join $tk_library button.tcl]
so..."
(file "/usr/local/share/tk8.3/tk.tcl" line 308)
invoked from within
"source /usr/local/share/tk8.3/tk.tcl"
("uplevel" body line 1)
invoked from within
"uplevel \#0 [list source $file]"
This probably means that tk wasn't installed properly.
$sudo gedit /usr/local/share/tk8.3/text.tcl
打開text.tcl文件,註釋掉457~459行。
啓動正常get
本文歡迎轉載,但請註明做者與出處:編譯器
做者:流星string