ubuntu13.04安装ns2.35

转自:http://blog.sina.com.cn/s/blog_b0992ce90101apqu.html



step 2:安装依赖包
             
sudo apt-get install tcl8.5-dev tk8.5-dev
sudo apt-get install gcc-4.4 g++-4.4
sudo apt-get install build-essential autoconf automake
sudo apt-get install perl xgraph libxt-dev libx11-devlibxmu-dev

step 3 进入 ns-allinone-2.35 在终端./install安装
stpe 4修改环境变量。这个网上很多自己找吧
在/home/xxx/下 gedit .bashrc
添加代码如下:
#LD_LIBRARY_PATH
OTCL_LIB=/home/huangtaya/ns-allinone-2.35/otcl-1.14
NS2_LIB=/home/huangtaya/ns-allinone-2.35/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB
# TCL_LIBRARY
TCL_LIB=/home/huangtaya/ns-allinone-2.35/tcl8.5.10/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
# PATH
XGRAPH=/home/huangtaya/ns-allinone-2.35/bin:/home/huangtaya/ns-allinone-2.35/tcl8.5.10/unix:/home/huangtaya/ns-allinone-2.35/tk8.5.10/unix
# Note: the above two lines starting from XGRAPH should come in thesame line
NS=/home/huangtaya/ns-allinone-2.35/ns-2.35/
NAM=/home/huangtaya/ns-allinone-2.34/nam-1.15/
PATH=$PATH:$XGRAPH:$NS:$NAM

可惜我在第三步时,出现错误
linkstate/ls.cc:396:28: required from here
linkstate/ls.h:137:20: error: ‘erase’ was not declared in thisscope, and no declarations were found by argument-dependent lookupat the point of instantiation [-fpermissive]
linkstate/ls.h:137:20: note: declarations in dependent base‘std::map<int, LsIdSeq,std::less<int>,std::allocator<std: air<constint, LsIdSeq> > >’ arenot found by unqualified lookup
linkstate/ls.h:137:20: note: use ‘this->erase’instead
make: *** [linkstate/ls.o] Error 1
Ns make failed!
于是再次安装,这次在 ns-allinone-2.35目录下输入  exportCC=gcc-4.4 CXX=g++-4.4 &&./install
安装还是不成功
于是把解压的 ns-allinone-2.35删除,再次解压。再在 ns-allinone-2.35下输入 exportCC=gcc-4.4 CXX=g++-4.4 &&./install
这次安装成功
如果还是不成功可以该ls.h文件的代码
void eraseAll() { erase(baseMap::begin(), baseMap::end()); } 
改为:
void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值