要想不麻烦 就要按最新版的gcc和ns2
这样一般一点问题也没有。。
要不就悲剧了。。
首先得安装必备软件包
# yum install autoconf automake gcc-c++ libX11-devel xorg-x11-proto-devel /
libXt-devel libXmu-devel
贴几个出现的问题~
问题一(2.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..."
解决方法:
在tk-8.4.14/generic/tbBind.c的第588行添加:
#ifdef GenericEvent
/* GenericEvent */ 0,
#endif
问题二
ubuntu10.04上装ns-allinone-2.33的问题
/home/gang/ns-allinone-2.33/otcl-1.13/otcl.c:2284: undefined reference to `__stack_chk_fail_local'ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't definedld: final link failed: Nonrepresentable section on outputmake: *** [libotcl.so] 错误 1otcl-1.13 make failed! Exiting ...
ld的问题,在gcc 4.0版本以前是用ld -share来生成共享库,但是到了4.0以及以上版本,这个命令改为了gcc -share
进入otcl-1.13目录,找到configure.in.
将77行,
SHLIB_LD="ld -shared"
改为
SHLIB_LD="gcc -shared"
同时修改configure 第5518行
SHLIB_LD="ld -shared"
改为
SHLIB_LD="gcc -shared"
重新./install
最后
要编辑~/.bashrc
export PATH=$PATH:~/ns-allinone-2.33/bin:~/ns-allinone-2.33/tcl8.4.18/unix:/home/bpc/ns-allinone-2.33/tk8.4.18/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/bpc/ns-allinone-2.33/otcl-1.13:/home/bpc/ns-allinone-2.33/lib
export TCL_LIBRARY=$TCL_LIBRARY:/home/bpc/ns-allinone-2.33/tcl8.4.18/library