Ubuntu14.04下安装NS2.35
2014-12-18 15:15
232 查看
1. 预先安装几个组件:
sudo apt-get install build-essential
sudo apt-get install tcl8.4 tcl8.4-devtk8.4 tk8.4-dev
sudo apt-get install libxmu-dev
2. 命令解压安装包
tar xvfz nsallinone2.31.tar.gz
3. 安装
cd /home/administrator/ns-allinone-2.35
./install
4. 错误解析:
In file included from linkstate/ls.cc:67:0:
linkstate/ls.h: In instantiation of ‘voidLsMap::eraseAll() [with Key = int; T = LsIdSeq]’:
linkstate/ls.cc:396:28: required from here
linkstate/ls.h:137:20: error: ‘erase’ was notdeclared in this scope, and no declarations were found by argument-dependentlookup at the point of instantiation [-fpermissive]
linkstate/ls.h:137:20: note: declarations independent base ‘std::map, std::allocator > >’ are not found byunqualified lookup
linkstate/ls.h:137:20: note: use ‘this->erase’instead
make: *** [linkstate/ls.o] Error 1
Ns make failed!
(1).find -name ls.h
显示出错误的绝对路径:gedit ./ns-2.35/linkstate/ls.h
(2)gedit ./ns-2.35/linkstate/ls.h
(3)在文本编辑器gedit下更改错误:
--错误显示为:void eraseALL{erase(baseMap::begin(),baseMap::end());}
--错误更改提示:note:use ‘this->erase’instead
--方法:gedit下搜索erase(baseMap::begin(),baseMap::end()),然后在文本编辑器gedit里边在erase前加上this->,
变为:voideraseALL{this->erase(baseMap::begin(),baseMap::end());}
更改后保存,重新./install
错误提示:
Ns-allinone package has been installedsuccessfully.
Here are the installation places:
tcl8.5.10:/home/ubuntu/ns-allinone-2.35/{bin,include,lib}
tk8.5.10:/home/ubuntu/ns-allinone-2.35/{bin,include,lib}
otcl: /home/ubuntu/ns-allinone-2.35/otcl-1.14
tclcl: /home/ubuntu/ns-allinone-2.35/tclcl-1.20
ns: /home/ubuntu/ns-allinone-2.35/ns-2.35/ns
nam: /home/ubuntu/ns-allinone-2.35/nam-1.15/nam
xgraph:/home/ubuntu/ns-allinone-2.35/xgraph-12.2
gt-itm: /home/ubuntu/ns-allinone-2.35/itm, edriver, sgb2alt, sgb2ns, sgb2comns,sgb2hierns
----------------------------------------------------------------------------------
Please put/home/ubuntu/ns-allinone-2.35/bin:/home/ubuntu/ns-allinone-2.35/tcl8.5.10/unix:/home/ubuntu/ns-allinone-2.35/tk8.5.10/unix
into your PATH environment; so that you'll beable to run itm/tclsh/wish/xgraph.
IMPORTANT NOTICES:
(1) You MUST put/home/ubuntu/ns-allinone-2.35/otcl-1.14,/home/ubuntu/ns-allinone-2.35/lib,
into your LD_LIBRARY_PATHenvironment variable.
If it complains about X libraries,add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can setit like:
setenv LD_LIBRARY_PATH <paths>
If you are using sh, you can setit like:
export LD_LIBRARY_PATH=<paths>
(2) You MUST put /home/ubuntu/ns-allinone-2.35/tcl8.5.10/libraryinto your TCL_LIBRARY environmental
variable. Otherwise ns/nam willcomplain during startup.
(4)环境更改:
按着提示修改环境变量,到home目录下
gedit ~/.bashrc 或者 sudo vim .bashrc
在文件最后加入:
exportPATH="$PATH:/home/administrator/ns-allinone-2.35/bin:/home/administrator/ns-allinone-2.35/tcl8.5.10/unix:/home/administrator/ns-allinone-2.35/tk8.5.10/unix"
exportLD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/administrator/ns-allinone-2.35/otcl-1.14,/home/administrator/ns-allinone-2.35/lib"
exportTCL_LIBRARY="$TCL_LIBRARY:home/administrator/ns-allinone-2.35/tcl8.5.10/library"
注意安装路径的更改
(5)关闭终端,重启终端
输入ns,出现%;
OK!!!
sudo apt-get install build-essential
sudo apt-get install tcl8.4 tcl8.4-devtk8.4 tk8.4-dev
sudo apt-get install libxmu-dev
2. 命令解压安装包
tar xvfz nsallinone2.31.tar.gz
3. 安装
cd /home/administrator/ns-allinone-2.35
./install
4. 错误解析:
In file included from linkstate/ls.cc:67:0:
linkstate/ls.h: In instantiation of ‘voidLsMap::eraseAll() [with Key = int; T = LsIdSeq]’:
linkstate/ls.cc:396:28: required from here
linkstate/ls.h:137:20: error: ‘erase’ was notdeclared in this scope, and no declarations were found by argument-dependentlookup at the point of instantiation [-fpermissive]
linkstate/ls.h:137:20: note: declarations independent base ‘std::map, std::allocator > >’ are not found byunqualified lookup
linkstate/ls.h:137:20: note: use ‘this->erase’instead
make: *** [linkstate/ls.o] Error 1
Ns make failed!
(1).find -name ls.h
显示出错误的绝对路径:gedit ./ns-2.35/linkstate/ls.h
(2)gedit ./ns-2.35/linkstate/ls.h
(3)在文本编辑器gedit下更改错误:
--错误显示为:void eraseALL{erase(baseMap::begin(),baseMap::end());}
--错误更改提示:note:use ‘this->erase’instead
--方法:gedit下搜索erase(baseMap::begin(),baseMap::end()),然后在文本编辑器gedit里边在erase前加上this->,
变为:voideraseALL{this->erase(baseMap::begin(),baseMap::end());}
更改后保存,重新./install
错误提示:
Ns-allinone package has been installedsuccessfully.
Here are the installation places:
tcl8.5.10:/home/ubuntu/ns-allinone-2.35/{bin,include,lib}
tk8.5.10:/home/ubuntu/ns-allinone-2.35/{bin,include,lib}
otcl: /home/ubuntu/ns-allinone-2.35/otcl-1.14
tclcl: /home/ubuntu/ns-allinone-2.35/tclcl-1.20
ns: /home/ubuntu/ns-allinone-2.35/ns-2.35/ns
nam: /home/ubuntu/ns-allinone-2.35/nam-1.15/nam
xgraph:/home/ubuntu/ns-allinone-2.35/xgraph-12.2
gt-itm: /home/ubuntu/ns-allinone-2.35/itm, edriver, sgb2alt, sgb2ns, sgb2comns,sgb2hierns
----------------------------------------------------------------------------------
Please put/home/ubuntu/ns-allinone-2.35/bin:/home/ubuntu/ns-allinone-2.35/tcl8.5.10/unix:/home/ubuntu/ns-allinone-2.35/tk8.5.10/unix
into your PATH environment; so that you'll beable to run itm/tclsh/wish/xgraph.
IMPORTANT NOTICES:
(1) You MUST put/home/ubuntu/ns-allinone-2.35/otcl-1.14,/home/ubuntu/ns-allinone-2.35/lib,
into your LD_LIBRARY_PATHenvironment variable.
If it complains about X libraries,add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can setit like:
setenv LD_LIBRARY_PATH <paths>
If you are using sh, you can setit like:
export LD_LIBRARY_PATH=<paths>
(2) You MUST put /home/ubuntu/ns-allinone-2.35/tcl8.5.10/libraryinto your TCL_LIBRARY environmental
variable. Otherwise ns/nam willcomplain during startup.
(4)环境更改:
按着提示修改环境变量,到home目录下
gedit ~/.bashrc 或者 sudo vim .bashrc
在文件最后加入:
exportPATH="$PATH:/home/administrator/ns-allinone-2.35/bin:/home/administrator/ns-allinone-2.35/tcl8.5.10/unix:/home/administrator/ns-allinone-2.35/tk8.5.10/unix"
exportLD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/administrator/ns-allinone-2.35/otcl-1.14,/home/administrator/ns-allinone-2.35/lib"
exportTCL_LIBRARY="$TCL_LIBRARY:home/administrator/ns-allinone-2.35/tcl8.5.10/library"
注意安装路径的更改
(5)关闭终端,重启终端
输入ns,出现%;
OK!!!
相关文章推荐
- ns-allinone-2.35在ubuntu14.04环境下的安装
- ubuntu14.04下安装ns2.35 的问题
- Ubuntu 14.04下安装ns-2.35详细教程
- ubuntu14.04上安装ns-allinone-2.35
- ubuntukylin14安装ns-allinone-2.35教程(虚拟机ubuntu同理)
- 在win7_64bit + ubuntu-12.04-desktop-amd64+VMware-workstation-full-10.0.1-1379776平台上安装ns-allinone-2.35
- Ubuntu10.04下安装ns-allinone-2.35
- ubuntu13.04安装ns2.35
- 物联网仿真 ns-allinone-2.35 安装教程 ubuntu16.04下安装 与使用
- Ubuntu 安装ns2.35+nam
- Ubuntu16.04下安装ns2.35
- Leach protocol installation in ns-2.35 under Ubuntu 14.04
- Ubuntu 13.04 安装ns2.35
- linux中文输入法&&NS2.35在ubuntu上安装
- Ubuntu 11.10下安装NS2.35
- SUMO仿真快速入门系列四:Ubuntu 12.04 安装ns2.35
- ubuntu14.3下安装ns2.35安装详解
- 在ubuntu14.04中安装和配置NS-2
- NS-2.35在ubuntu 11.04下的安装
- Ubuntu16.04下安装ns2.35