在ubuntu中安裝 Source-Navigator及使用手冊(zzzz)

1 通過apt-get安裝(版本較舊)
安裝命令:sudo apt-get install sourcenav
啓動命令:snavigator

2 手動安裝最新版本
1)到官方網站獲取軟件包
http://sourceforge.net/project/showfiles.php?group_id=51180
2)解壓縮
tar zxvf s ourcenav-6.0.tar.gz
sudo ./configure --prefix=/opt/sourcenav  (install 文件推薦參數)
sudo make
sudo make install
ps:如果出現權限問題,前面加sudo
3)如果碰到下述錯誤
/root/tk8.4.16/unix/../generic/tk3d.c:1279: error: ‘TkBorder’ has no member named ‘resourceRefCount’
/root/tk8.4.16/unix/../generic/tk3d.c:1280: error: ‘Tk_FakeWin’ has no member named ‘display’
/root/tk8.4.16/unix/../generic/tk3d.c:1280: error: ‘Tk_FakeWin’ has no member named ‘screenNum’
/root/tk8.4.16/unix/../generic/tk3d.c:1280: error: ‘TkBorder’ has no member named ‘screen’
/root/tk8.4.16/unix/../generic/tk3d.c:1281: error: ‘Tk_FakeWin’ has no member named ‘atts’
/root/tk8.4.16/unix/../generic/tk3d.c:1281: error: ‘TkBorder’ has no member named ‘colormap’
/root/tk8.4.16/unix/../generic/tk3d.c:1301: error: ‘TkDisplay’ has no member named ‘borderTable’
/root/tk8.4.16/unix/../generic/tk3d.c:1301: error: ‘TkDisplay’ has no member named ‘borderTable’
/root/tk8.4.16/unix/../generic/tk3d.c:1306: error: ‘TkBorder’ has no member named ‘nextPtr’
。。。。。。
則在終端是輸入:sudo apt-get install libx11-dev

接着重新運行

sudo ./configure --prefix=/opt/sourcenav  (install 文件推薦參數)
sudo make
sudo make install


4) 啓動snavigator
在終端直接輸入:/opt/sourcenav/bin/snavigator
5) 使用手冊(user manual)
http://sourcenav.sourceforge.net/online-docs/userguide/index_ug.html


還有一個 source insight 和source navigator的比較的帖子:
http://fky168.blog.163.com/blog/static/3786097200831033957620/

========================================================
運行source navigator的問題
方法一、(轉載)
安裝完成後運行 snavigator 提示
[root@MagicLinux sourcenav-6.0]# snavigator
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 <MouseWheel> {
%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 30
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.

不知其所以然,重新安裝tk8.3無效,升級到tk8.5無效

後來在網上發現需要給下載的Source-Navigator 6.0打補丁
到http://bugs.gentoo.org/show_bug.cgi?id=225999 找到 tk-8.4-lastevent.patch 補丁
將補丁粘貼到source navigator 源碼目錄 sourcenav-6.0/tk目錄下,再cd 到sourcenav-6.0/ tk 的源碼目錄
patch -p0 -i tk-8.4-lastevent.patch
刪除安裝,重新安裝,可以運行了(我試了一下不行) 。

方法二、(轉載此方法可行 )
有找到解法:
(http://forums.fedoraforum.org/showthread.php?t=213441)
註掉 lines 182-184 in the file /opt/sourcenav/share/tk8.3/listbox.tcl
註掉 lines 457-459 in the file /opt/sourcenav/share/tk8.3/text.tcl

在panel中添加Launcher,在Command中添加/opt/sourcenav/bin/snavigator

 

 

 



====== 安裝完後在桌面增加捷徑的方法 ======
我要做捷徑的目標是/opt/sourcenav/bin/snavigator (這是個sh script)
裡面要改一行
#snbindir=`dirname $0`
snbindir=/opt/sourcenav/bin
這樣再建一個捷徑到桌面即可:
ln -s /opt/sourcenav/bin/snavigator ~/Desktop/ 

 

轉自:http://hi.baidu.com/superql/blog/item/d6f31655a05cccceb645ae76.html

 

 

 

 

 

充另一種安裝方法 沒有親自實驗

在Linux環境下呢,百度了下,看到了source navigator,不少人推薦使用這個工具用來查看源代碼。它是red hat開發的一個IDE,但是大部分人均用它來閱讀,而不是開發,總而言之,不多廢話,看看在Ubuntu10.4下,如何安裝 

步驟如下: 

1. 下載最新的source navigator包,URL爲: http://sourceforge.net/projects/sourcenav/ 
我下的最新的包爲sourcenav-6.0.tar.gz ,大小:18.9MB. 

2.進入到文件目錄 

3.解壓之,命令:tar zxvf sourcenav-6.0.tar.gz 

4. 準備安裝咯,首先執行命令:sudo ./configure --prefix=/opt /sourcenav

5. 網上很多方法都是先make,然後看看是否可以通過,若是一次性安裝成功了那還好說,否則會比較麻煩。這裏推薦大家在make之前,先這樣做: 
暫時先別make,因爲大家的系統很多時候很多包沒用安裝,即使安裝了也沒關係,因爲終端會提示,如果安裝了只會檢測更新,而不會重新安裝它,因此, 
先安裝libx11-dev。在終端下執行如下命令: 
sudo apt-get install libx11-dev 

6. 安裝好之後,我們需要更改一個頭文件。在目錄/opt/sourcenav-6.0/tk/generic下,找到tk.h文件,打開它,然後參照下面的文本修改它。首先在tk.h文件中,找到如下所示的定義處,將以下語句中帶有'-'號的在tk.h中註釋起來(註釋的方法是:在該語句的最前面加上//),將語句前面帶有'+'號的語句複製到其中,其它的語句保持不變就ok,然後保存,退出。(如果不修改,編譯後啓動不了,報tk未成功安裝) 

-#define VirtualEvent (LASTEvent) 
-#define ActivateNotify (LASTEvent + 1) 
-#define DeactivateNotify (LASTEvent + 2) 
-#define MouseWheelEvent (LASTEvent + 3) 
-#define TK_LASTEVENT (LASTEvent + 4) 
+#define VirtualEvent (MappingNotify + 1) 
+#define ActivateNotify (MappingNotify + 2) 
+#define DeactivateNotify (MappingNotify + 3) 
+#define MouseWheelEvent (MappingNotify + 4) 
+#define TK_LASTEVENT (MappingNotify + 5) 
#define MouseWheelMask (1L << 28) // 以下三條語句必須要有(包括本條),若原來沒有,則需要添加! 
#define ActivateMask (1L << 29) // 
#define VirtualEventMask (1L << 30) // 
-#define TK_LASTEVENT (LASTEvent + 4) 

7. 接下來,執行命令:sudo make 

8.執行命令:sudo make install,結束後,在終端中鍵入snavigator便可運行source navigator了。如果還是提示有問題,請仔細檢測下第6步的修改是否是正確的,這裏稍微要留神。 

9.安裝好之後的source navigator可從終端用命令行啓動。若是不習慣,而喜歡從應用菜單開始,可以創建一個項目到應用菜單中。執行:sudo gedit /usr/share/applications/source-navigator.desktop 
將下面文本複製,並保存退出,便可在應用菜單中看到source navigator了。注意:除了Icon那一行之外,每行的後面不能有空格,否則有可能在應用菜單中無法顯示source navigator項。 


[Desktop Entry] 
Name=Source-Navigator 
Comment=看代碼的工具 
Exec=/opt/sourcenav/bin/snavigator 
Icon= 
Terminal=false 
Type=Application 
Categories=Application;Development;


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章