装好NS2.33后,当调用nam时,出现如下错误
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."
这个是由于nam调用的tk组件和xproto-7.0.13不兼容导致的(xproto-7.0.13 新添加了 GenericEvent)。 解决方法:
到这里下载补丁http://bugs.gentoo.org/show_bug.cgi?id=225999
或者新建一个记事本复制一下内容到里面,保存,命名为“tk-8.4.18-tkBind.patch”(将.txt后缀名改为.patch)
--- tk8.4.18-orig/generic/tkBind.c 2006-07-21 08:26:54.000000000 +0200
+++ tk8.4.18/generic/tkBind.c 2008-07-05 12:17:10.000000000 +0200
@@ -586,6 +586,9 @@
COLORMAP,
0,
0,
+#ifdef GenericEvent
+ 0,
+#endif
VIRTUAL,
ACTIVATE,
ACTIVATE,)
然后在ns-allinone-2.33下运行patch -p0 < tk-8.4.18-tkBind.patch
会出现:
直接把补丁放在ns-allinone-2.33下运行就行~tk8.4.18/generic/tkBind.c
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- tk8.4.18-orig/generic/tkBind.c 2006-07-21 08:26:54.000000000 +0200
|+++ tk8.4.18/generic/tkBind.c 2008-07-05 12:17:10.000000000 +0200
--------------------------
File to patch:
然后去查找需要打补丁的文件tkBind.c,它在NS2.30中的位置是~/ns-allinone-2.30/tk8.4.13/generic
在“File to patch: ”后填写好路径名和文件名,打上补丁。
然后重装ns-2.33。
最后,需要将ns-2.33中的“ns”和nam-1.12中的“nam”拷贝到/usr/local/bin下面。
这样就能正常调用ns和nam了。
Thanks to : http://blog.sina.com.cn/s/blog_4c8287230100h5g5.html