作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在尝试使用 NS 2.35 对 AODV 路由协议(protocol)进行一些改进。我对 AODV.cc 和 AODV.h 文件做了一些修改。为了使更改生效,我从终端在 NS 2.35 文件夹中执行了以下三个命令:
2.清洁
3.制作
现在我遇到了以下错误:
trace/cmu-trace.o: In function `CMUTrace::format_aodv(Packet*, int)':
cmu-trace.cc:(.text+0x18b7): undefined reference to `hdr_aodv::offset_'
解决这个问题的方法是什么?
为了进一步说明,我在此处提供了 .cc 文件链接:
https://drive.google.com/file/d/0B1OEPsG0ILELWkcxQ254TEpoN3M/view?usp=sharing
最佳答案
当然你一定会得到一个错误...你已经更改了一些将在 cmu-trace.cc
中使用的打印参数。
我不知道你想做什么,但很明显你不应该更改 fprintf
中的那些参数。
喜欢这里:
fprintf(stderr,
"%s%d\t%s%d\t%s%d\t%s%d\t%s%d\t%s%d\t%s%d\t%s%d\t%s%f\t%s%f\n",
"src=", index,
"dst=", rp->rp_dst,
"nhops=", rp->rp_hop_count+1,
"opthops=", opthops,
"sumHops=", sumHops,
"sumGodHops=", sumGodHops,
"numRtsFound=", numRtsFound,
"prevHop=", ch->prev_hop_,
"t:", CURRENT_TIME,
"RTT=", CURRENT_TIME - rp->rp_timestamp);
fprintf(gspTraceFile,
"%s%d\t%s%d\t%s%d\t%s%d\t%s%d\t%s%d\t%s%d\t%s%d\t%s%f\t%s%f\n",
"src=", index,
"dst=", rp->rp_dst,
"nhops=", rp->rp_hop_count+1,
"opthops=", opthops,
"sumHops=", sumHops,
"sumGodHops=", sumGodHops,
"numRtsFound=", numRtsFound,
"prevHop=", ch->prev_hop_,
"t:", CURRENT_TIME,
"RTT=", CURRENT_TIME - rp->rp_timestamp);
确切地说出你想做什么,也许我可以帮助你,或者其他人可以帮助你。
关于linux - "undefined reference to ` hdr_aodv::offset_ '"网络模拟器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33807898/
我正在尝试使用 NS 2.35 对 AODV 路由协议(protocol)进行一些改进。我对 AODV.cc 和 AODV.h 文件做了一些修改。为了使更改生效,我从终端在 NS 2.35 文件夹中执
我是一名优秀的程序员,十分优秀!