



免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
系统环境为ubuntu8.04.4,gcc v4.2.4首先下载ns-allinone-2.29.tar.gz, ns-2.29-nist-mob.tgz和pmip6-for-ns-2.29-nist.patch文件下载到目录/home/bt/ns2/(1).sudo apt-get install build-essential,这样可以安装gcc,make。(2).安装tk,tcl sudo apt-get install tcl8.4 sudo apt-get install tcl8.4-dev sudo apt-get install tk8.4 sudo apt-get install tk8.4-dev(3).sudo apt-get install libxmu-dev,是和nam有关的东西。完毕。1,解压文件夹ns2.29,修改里面的nam文件夹中agent.h的73行,将后面的null改为0;sudo tar -vxzf ns-allinone-2.29.tar.gz #解压到当前目录/home/bt/ns2/cd ns-allinone-2.29 #进入目录将ns-2.29-nist-mob包中ns-2.29文件夹替换ns-allinone-2.29包中ns-2.29文件夹,并在ns-allinone-2.29中添加pmip6-for-ns-2.29-nist.patch补丁包;然后安装NS2-2.29。2,sudo ./install #开始安装3,安装的时候出现众多error,大概分为两种类型:一是在某函数前面的某个“限定错误”,修改办法是找到ns2.29中该处错误的地方,将该限定删除;二是出现函数未声明的错误,在C语言里将函数定义放在后面,而在前面调用则一定要在文件的最开头声明函数原型, Ubuntu8.04.4是遵循这一原则的,但在ns2.29中则不是如此,并没有在文件开头声明函数原型,奇怪的是在很多Linux版本(Fedora6/Ubuntu6.06)中安装的时候竟然不会报错,如果在Ubuntu8.04.4上安装ns2.29则需要你自己找出报错地方添加声明。问题1checking system version (for dynamic loading). ./configure: 1: Syntax error: Unterminated quoted stringtcl8.3.2 configuration failed! Exiting .Tcl is not part of the ns project. Please see www.Sto see if they have a fix for your platform.解决方法分别进入以下目录:tcl8.x.x/unix/tcl.m4.tk8.x.x/unix/tcl.m4.otcl-1.x/configure.in.将这些文件里的system=MP-RAS-awk print 3 /tc/.relid 改为:system=MP-RAS-awk print 3 /etc/.relid 然后再在这三个目录下运行命令autoconf.每个目录下运行两次回到目录ns-allinone-2.29下,重新运行 sudo ./install问题2:make: * libotcl.so 错误 1 otcl-1.11 make failed! Exiting . See /nsnam/ns/ns-problems.html for problems gcc 4.0版本以前是用ld -share来生成共享库的,但是到了4.0以上的版本,这个命令改为了gcc -share。在终端里输入gcc -v查看,我的版本是gcc version 4.4.3。 开始修改。 cd /home/bt/ns2 /ns-allinone-2.29/otcl-1.11 sudo gedit configure.in 把77行的SHLIB_LD=ld -shared,改为SHLIB_LD=gcc -shared,保存退出。然后 sudo gedit configure按照2中的说法,在5576行, 把SHLIB_LD=ld -shared改为SHLIB_LD=gcc -shared,保存退出。注意位置:case $system inLinux*) SHLIB_CFLAGS=-fpic SHLIB_LD=gcc -shared SHLIB_SUFFIX=.so DL_LIBS=-ldl SHLD_FLAGS= cd回到目录ns-allinone-2.29下,重新运行sudo ./install还有一些问题,可以到/jerry_916/blog/item/e0e7085516213d51d009065b.html寻找答案。该博客中记录了安装NS相关错误及修正方法。现把部分摘录如下:问题(1)-I./asim/ -I./qs -I./diffserv -I./satellite -I./wpan -o trace/trace.o trace/trace.cc./sctp/sctp.h:705: error: extra qualification SctpAgent: on member DumpSendBuffermake: * trace/trace.o Error 1solution:将文件ns2.29/sctp.h里面第705行DumpSendBuffer函数前面的SctpAgent:去掉。这个问题是由于g+的版本差异引起的,用低版本的g+可能不会有问题。如果可以修改源码的话,找到出错的函数所在的位置。在类的定义中写了void Sctpagent:dumpsendbuffer(); 在类中应该写 void dumpsendbuffer();才对。 都是很基本的错误。不同编译器, 不同版本, 差别不小, 最好保证自己的代码在高版本的编译器下没有问题。问题(2)./mobile/god.h:88: error: extra qualification vector: on member operator=./mobile/god.h:93: error: extra qualification vector: on member operator+=./mobile/god.h:98: error: extra qualification vector: on member operator=./mobile/god.h:101: error: extra qualification vector: on member operator!=make: * src_rtg/sragent.o Error 1solution: 分别将这些文件里面的vector:去掉。问题(3)dsr/dsragent.cc:828: error: XmitFlowFailureCallback was not declared in this scopedsr/dsragent.cc:1385: error: XmitFailureCallback was not declared in this scopedsr/dsragent.cc:1386: error: XmitFlowFailureCallback was not declared in this scopedsr/dsragent.cc:1403: error: XmitFailureCallback was not declared in this scopemake: * dsr/dsragent.o Error 1solution:It is unclear to me which version of the code and compiler you are using. But it looks very similar to an error that I encountered with the CVS version and the latest gcc version. You should look into the file if you can find the missing function. In my case it was declared at the endof the file without a forward declaration. If so , you just need to move it to the beginning of the file or add an forward declaration for the function at the beginning.$gedit /usr/NS2/ns-allinone-2.29/ns-2.29/dsr/dsragent.cc+void XmitFlowFailureCallback(Packet *pkt, void *data); /+即增加,-即去掉+void XmitFailureCallback(Packet *pkt, void *data);/*=SendBuf management and helpers问题(4)diffusion/diffusion.cc:427: error:XmitFailedCallback was not declared in this scopemake: * diffusion/diffusion.o error 1solution:$gedit /usr/NS2/ns-allinone-2.29/ns-2.29/diffusion/diffusion.cc#include routing_table.h+void XmitFailedCallback(Packet *pkt, void *data);char *MsgStr= , INTEREST, DATA, DATA_READY, DATA_REQUEST,问题(5)tcp/tcp-sack-rh.cc:68: 错误:有多余的限定 SackRHTcpAgent:在成员 newack 上make: * tcp/tcp-sack-rh.o 错误 1solution:同问题(1)和(2)问题(6)pgm/pgm-agent.cc:307: 错误:有多余的限定 PgmAgent: 在成员 trace_event 上make: * pgm/pgm-agent.o 错误 1solution:同问题(1)问题(7)pgm/pgm-sender.cc:189: 错误:有多余的限定 PgmSender: 在成员 trace_event 上make: * pgm/pgm-sender.o 错误 1solution:同问题(1)问题(8)pgm/pgm-receiver.cc:186: 错误:有多余的限定 PgmReceiver:在成员 trace_event 上make: * pgm/pgm-receiver.o 错误 1solution:同问题(1)问题(9)diffusion/omni_mcast.cc:367: 错误:OmniMcastXmitFailedCallback在此作用域中尚未声明make: * diffusion/omni_mcast.o 错误 1solution:$gedit /usr/NS2/ns-allinone-2.29/ns-2.29/diffusion/omni_mcast.cc#include god.h+void OmniMcastXmitFailedCallback(Packet *pkt, void *data);static class OmniMcastClass : public TclClass 4,设置环境变量:修改用户目录(你自己的个人用户和root用户,个人用户目录一般在/home下面,root用户目录就是/root)下的.bashrc(注意该文件为隐藏文件),在该文件末尾加上以下三句话:exportPATH=$PATH:/home/bt/ns2/ns-allinone-2.29/bin:/home/bt/ns2/ns-allinone-2.29/tcl8.4.11/unix:/home/bt/ns2/ns-allinone-2.29/tk8.4.11/unixexportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/bt/ns2/ns-allinone-2.29/otcl-1.11:/home/bt/ns2/ns-allinone-2.29/libexportTCL_LIBRARY=/home/bt/ns2/ns-allinone-2.29/tcl8.4.11/library5,验证:如果环境变量设置正确,直接运行ns会出现%,或者可以运行软件自带的例子,在/home/ns2/ns-allinone-2.29/ns-2.29/ns-t
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 住房公积金个人住房抵押贷款变更合同
- 2025年美术联考国家题库及答案
- 专业领域能力测试题及答案
- 消防安全演练培训新闻稿课件
- 血糖的监测和管理
- NEC造瘘个案护理教学查房
- 消防安全校外培训课件
- 消防安全标准化培训课件
- ICU新入职护士年终总结
- 急诊科半年度工作总结
- 9《犟龟》公开课一等奖创新教学设计
- 2025年乡村产业发展笔试模拟题库
- 2025滨海投资(天津)有限公司校园招聘考试备考题库及答案解析
- 2024-2025学年度江西建设职业技术学院单招《职业适应性测试》题库试题【名师系列】附答案详解
- 2025年辅警招聘考试试题库及答案(必刷)
- 基础化学(第五版)课件 第一章 物质结构基础
- 2025至2030中国社区团购行业发展趋势分析与未来投资战略咨询研究报告
- 桥面系监理质量控制细则
- GB/T 34399-2025医药产品冷链物流温控设施设备验证性能确认技术规范
- 2025年创伤急救题库(附答案)
- 重难点01溶质质量分数的分析与计算(重难点讲义)原卷版
评论
0/150
提交评论