您的位置:首页 > 其它

ns2中can't read "debug_": no such variable类似问题

2012-03-09 16:52 543 查看
前两天在ns2中加入两个agent,一个application,编译没有问题,但是在运行tcl文件时出现如下错误:

INITIALIZE THE LIST xListHead

can't read "debug_": no such variable

(Object set line 1)

invoked from within

"CMUTrace/Recv set debug_"

invoked from within

"catch "$c set $var" val"

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 "_o270" line 2)

(SplitObject unknown line 2)

invoked from within

"$sinkapp2 attach-agent $sinkagent2"

(file "test.tcl" line 200)

在网上找了一下,按照最简单的解决方法,查看ns-default.tcl文件。

然而在ns-default.tcl中找到了CMUTrace set debug_ 0的语句,不知道为什么对CMUTrace/Recv没有作用。而且自己加入语句CMUTrace/Recv
set debug_ 0,又会出现类似的错误,提示找不到其他变量。一直添加语句将CMUTrace/Recv的错误解决完之后,仍然有CMUTrace/Send甚至Queue中等等大同小异的错误。

更纠结的是,这样一直添加能解决问题也行,但到最后出现问题说找不到Simulator的变量nix,而且在ns-default.tcl中只找到Simulator set nix-routing 0 这句话,没有nix的设置。。。

拖了两天,突然发现application中command()函数最后缺少了return
(Application::command(argc, argv));

一定要细心啊,,一点小问题耽误两天时间啊~~~
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐