在孤独中享受寂寞,从寂寞中厮杀黎明!分享 http://blog.sciencenet.cn/u/duankesong 假如我不能,我一定要; 假如我一定要,我就一定能!

博文

附录1:NS-2文件调试错误详解与调试技巧

已有 10256 次阅读 2010-4-7 21:12 |个人分类:网络仿真|系统分类:科研笔记



 
can't read "ns_o3": no such variable while executing
"set ns[new Simulator]"
(file "example.tcl" line 2)
注:没有在ns[new Simulator] 中间加空格分隔符
[root@localhost ~]# ns example.tcl
    (_o3 cmd line 1)
    invoked from within
"_o3 cmd duplex -link _o10 _o16 2Mb 10ms DropTail"
    invoked from within
"catch "$self cmd $args" ret"
    invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
    (procedure "_o3" line 2)
    (SplitObject unknown line 2)
    invoked from within
"$ns duplex -link $n0 $n2 2Mb 10ms DropTail"
    (file "example.tcl" line 26)
注:duplex –link中间没有分割符。是一个整体
[root@localhost ~]# ns example.tcl
can't read "class_2": no such variable
    while executing
"subst $[subst $var]"
    (procedure "_o82" line 5)
    (Object next line 5)
    invoked from within
"_o82 next class_2"
    ("eval" body line 1)
    invoked from within
"eval $self next $args"
    (procedure "_o82" line 18)
    (Agent set line 18)
    invoked from within
"$tcp set class_2"
(file "example.tcl" line 38)
注:class_2中class_ 是变量 2是参数,中间要有分隔符。
总结:这次错误的主要点是对分割符的有无有点不理解,以后要多调试在能在实践中锻炼。技巧:在linux系统中,也存在快速的调用上次的命令,用键盘的上箭头即可。


https://blog.sciencenet.cn/blog-428172-309844.html

上一篇:网络仿真利器NS-2无师自通七天速成系列Ⅶ:协议添加
下一篇:附录4:诺基亚研究中心招聘实习生
收藏 IP: .*| 热度|

0

发表评论 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-19 23:41

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部