在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;


你可能感兴趣的:(File,ubuntu,library,button,终端,Terminal)