ubantu16.04安装ns2.34 错误
把ns2.34解压缩之后,sudo ./install
出现的错误:
错误一:安装NS2.34过程中出现如下的错误:
tools/ranvar.cc: In member function ‘virtual double GammaRandomVariable::value()’:
tools/ranvar.cc:219:70: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly
tools/ranvar.cc:219:70: error: for a function-style cast, remove the redundant ‘::GammaRandomVariable’
make: *** [tools/ranvar.o]错误1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
这是由于gcc版本提高后对类内部函数调用的简化造成的不兼容,解决方法如下:
在ns-allinone-2.34/ ns-2.34/tools文件夹下,找到报错提示中的ranvar.cc文件,打开找到对应的219行删除::GaammaRandomVariable,保存,
即:将219行的
return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
改为:
return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
然后保存退出,重新安装ns2.
======================================================================================
错误二:
In file included from mac/mac-802_11Ext.cc:66:0:
mac/mac-802_11Ext.h: In member function ‘u_int32_t PHY_MIBExt::getHdrLen11()’:
mac/mac-802_11Ext.h:175:19: error: expected primary-expression before ‘struct’
mac/mac-802_11Ext.h:175:41: error: ‘dh_body’ was not declared in this scope
mac/mac-802_11Ext.h:175:51: error: ‘offsetof’ was not declared in this scope
mac/mac-802_11Ext.h:177:3: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [mac/mac-802_11Ext.o] Error 1
Ns make failed!
下面是网上找得关于本问题的解决方案:
If you get error like:
mac/mac-802_11Ext.h: In member function ‘u_int32_t PHY_MIBExt::getHdrLen11()’:
mac/mac-802_11Ext.h:176:19: error: expected primary-expression before ‘struct’
mac/mac-802_11Ext.h:176:41: error: ‘dh_body’ was not declared in this scope
mac/mac-802_11Ext.h:176:51: error: ‘offsetof’ was not declared in this scope
open that file and add
#include <cstddef>
to the header files.
在ns-allinone-2.34\ns-2.34\mac\mac-802_11Ext.h 文件添加#include <cstddef>
然后重新安装,就OK了。
=============================================================================
错误三:
mobile/nakagami.cc: In member function ‘virtual double Nakagami::Pr(PacketStamp*, PacketStamp*, WirelessPhy*)’:
mobile/nakagami.cc:183:73: error: cannot call constructor ‘ErlangRandomVariable::ErlangRandomVariable’ directly
mobile/nakagami.cc:183:73: error: for a function-style cast, remove the redundant ‘::ErlangRandomVariable’
mobile/nakagami.cc:185:67: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly
mobile/nakagami.cc:185:67: error: for a function-style cast, remove the redundant ‘::GammaRandomVariable’
make: *** [mobile/nakagami.o]错误1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
解决方法:
在ns-allinone-2.34/ ns-2.34/ mobile文件夹下,找到报错提示中的nakagami.cc文件,打开找到对应的183行删除::ErlangRandomVariable,保存,
即:将183行的
resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();
改为:
resultPower = ErlangRandomVariable(Pr/m, int_m).value();
在ns-allinone-2.34/ ns-2.34/ mobile文件夹下,找到报错提示中的nakagami.cc文件,打开找到对应的185行删除::GammaRandomVariable,保存,
即:将185行的
resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();
改为:
resultPower = GammaRandomVariable(m, Pr/m).value();
=============================================================================
错误四:
In file included from linkstate/ls.cc:67:0:
linkstate/ls.h: In instantiation of ‘void LsMap<Key, T>::eraseAll() [with Key = int; T = LsIdSeq]’:
linkstate/ls.cc:396:28: required from here
linkstate/ls.h:137:58: 错误:‘erase’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
void eraseAll() { erase(baseMap::begin(), baseMap::end()); }
^
linkstate/ls.h:137:58: 附注:declarations in dependent base ‘std::map<int, LsIdSeq, std::less<int>, std::allocator<std::pair<const int, LsIdSeq> > >’ are not found by unqualified lookup
linkstate/ls.h:137:58: 附注:use ‘this->erase’ instead
Makefile:93: recipe for target 'linkstate/ls.o' failed
make: *** [linkstate/ls.o] Error 1
解决方法:
Go to ns-allinone-2.35/ns-2.35/linkstate/ b.Now edit ls.h
In line number 137, in place of void eraseAll() { erase(baseMap::begin(), baseMap::end()); }
make it void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }
=============================================================================
重新在ns目录下键入$ ./install安装,再次出现问题时,仿照解决方法,找到对应的文件和行数,修改即可。至此安装成功。
配置环境:修改home/wang目录下的 .bashrc文件
打开终端:sudo gedit .bashrc
在文件最后输入:
export PATH=$PATH:/home/wang/ns/ns-allinone-2.34/bin:/home/wang/ns/ns-allinone-2.34/tcl8.4.18/unix:/home/wang/ns/ns-allinone-2.34/tk8.4.18/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/wang/ns/ns-allinone-2.34/otcl-1.13:/home/wang/ns/ns-allinone-2.34/lib
export TCL_LIBRARY=$TCL_LIBRARY:/home/wang/ns/ns-alllinone-2.34/tcl8.4.18/library
=======================================================================================================================
终端输入ns之后出现%之后,说明暂时成功了。
运行./validate(貌似在ns-2.34目录下??)
会出现问题:
解决方法:
1. 网上说是gcc版本过高的问题,我们把gcc版本降为4.4。教程:http://blog.sina.com.cn/s/blog_6cee149d010129bl.html
2. 可能有些包没有安装:(这个存疑,可以安装试试)
sudo apt-get install libx11-dev xorg-dev libxmu-dev libperl4-corelibs-perl
貌似还是没能解决!!!!
ubantu16.04安装ns2.34 错误的更多相关文章
- ubantu10.04安装ns-2.34
LQ大神说是这个搭配才能完美移植leach 安装如下: 1. 安装必须的软件,因为版本较久远, sudo gedit /etc/apt/sources.list(大概是个意思) 把里面的内容换成: d ...
- 安装ns2.34,802.11p的各种包的时候遇到问题
安装教程:http://blog.sina.com.cn/s/blog_6735526a0102w1zs.html 802.11p补丁包:https://download.csdn.net/downl ...
- ubantu16.04安装sougou输入法
安装搜狗拼音输入法下载安装包:http://pinyin.sogou.com/linux/?r=pinyin如果直接安装不了,则按如下方法进行安装:sudo dpkg -i sogoupinyin_ ...
- ubantu16.04安装配置samba服务(原创)
1.安装samba服务 $ sudo apt-get install samba samba-common$ sudo apt-get install smbclient 如果你开启了防火墙,关闭: ...
- Ubuntu 16——安装——ns2.35和nam
Ubuntu 16.04 安装ns2.35+nam 总结出以下安装步骤 1: 更新源 sudo apt-get update #更新源列表 sudo apt-get upgrade #更新已经安装的包 ...
- Ubuntu12.04中安装ns-allinone-2.34
1.首先安装ns2所需的组件.库之类: $sudo apt-get update $sudo apt-get install build-essential $ tcl8.-dev tk8. tk8. ...
- Ubuntu12.04安装64位系统出现编译错误error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or dir
问题: Ubuntu12.04安装64位系统出现编译错误error while loading shared libraries: libz.so.1: cannot open shared obje ...
- Ubuntu12.04 LTS 32位 安装ns-2.35
ubuntu12.04lts 32-bit默认采用gcc 4.6和g++4.6,而ns的最新版本ns 2.3.5也采用了相同到版本,所以这方面不会有版本不同到问题 收回上面这句话..../valida ...
- ubantu16.04+mxnet +opencv+cuda8.0 环境搭建
ubantu16.04+mxnet +opencv+cuda8.0 环境搭建 建议:环境搭建完成之后,不要更新系统(内核) 转载请注明出处: 微微苏荷 一 我的安装环境 系统:ubuntu16.04 ...
随机推荐
- ASP.NET知识点汇总
一 ,html属性20181113常用的居中方法1 text-align2 float3 margin (margin-left matgin-right margin-bottom margin-t ...
- 关于访问Jira和Confluence服务越来越缓慢的解决办法阐述
Jira和Confluence部署在同一台服务器上,跑一段时间后,发现访问jira和confluence时,打开越来越缓慢.这是因为根据主机物理内存不同,默认的java虚拟机内存也会不同(一个较低值) ...
- 神经网络6_CNN(卷积神经网络)、RNN(循环神经网络)、DNN(深度神经网络)概念区分理解
sklearn实战-乳腺癌细胞数据挖掘(博客主亲自录制视频教程,QQ:231469242) https://study.163.com/course/introduction.htm?courseId ...
- 02 Redis关闭服务报错---(error) ERR Errors trying to SHUTDOWN. Check logs.
127.0.0.1:6379> shutdown (error) ERR Errors trying to SHUTDOWN. Check logs. 1.在redis.conf中修改日志文件的 ...
- Stm32 GPIO复习
地点:中图四楼. 1.七个寄存器 配置寄存器:GPIOx_CPL.GPIOx_CPH; 数据寄存器:GPIOx_IDR.GPIOx_ODR: 置位/复位寄存器:GPIOx_BSRR 复位寄存器:GPI ...
- VOC2012数据集注解
VOC2012官网介绍:http://host.robots.ox.ac.uk/pascal/VOC/voc2012/index.html 分割部分:参考博客:https://blog.csdn.ne ...
- PHP实用工具类
2018年10月25日 20:21:09 组装SQL语句 适用MySQL, 链式调用, 组装后可传参选择是否查询数据库 项目地址: 码云 生成数据字典 适用MySQL, 链式调用, 可生成word, ...
- 帆软报表(finereport) 复选框多值查询
定义数据集 SELECT * FROM 库存 设计模板 设置控件:控件名称 XX 要与 单元格中 取值公式 =$XX 对应,控件值可更改 下拉复选框控件: 设置控件名称(与模板中=$选仓库 ...
- 【原创】大叔案例分享(3)用户行为分析--见证scala的强大
一 场景分析 用户行为分析应用的场景很多,像线上网站访问统计,线下客流分析(比如图像人脸识别.wifi探针等),比较核心的指标有几个: PV | UV | SD | SC 指标说明: PV(Page ...
- POJ1321 棋盘问题(简单搜索)
题意: 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别.要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放 ...