1.配置环境
$sudo apt-get install build-essential $sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev $sudo apt-get install libxmu-dev libxmu-headers(若执行
sudo apt-get install build-essential出现问题
unable to loate package build-essential
则两步解决问题
$sudo apt-get update
$sudo apt-get install build-essential
)
2.window(即主机)下ar下载好最新ns-2.35的压缩包,即ns-allinone-2.35.tar.gz
下载地址
http://www.isi.edu/nsnam/ns/ns-build.html
3.ns-2.35的解压与安装
先将压缩包复制到ubuntu home/ns-2 文件夹下,提前新建一个ns-2文件夹在home目录下
分别执行命令
$tar -xzvf ns-allinone-2.35.tar.gz
$cd ns-allinone-2.35
$./install
肯定会出现问题(我的如下)
linkstate/ls.h:137:58: note: 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: note: use ‘this->erase’ instead make: *** [linkstate/ls.o] Error 1 Ns make failed!
解决办法:
$gedit ns-2.35/linkstate/ls.h
将第137行的 eraze 改为 this->eraze
再次执行