首页 > 代码库 > ubuntu下安装ns2详细步骤
ubuntu下安装ns2详细步骤
linkstate/ls.h: In instantiation of ‘void LsMap::eraseAll() [with Key = int; T = LsIdSeq]’:
linkstate/ls.cc:396:28: required from here
linkstate/ls.h:137:20: error: ‘erase’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
linkstate/ls.h:137:20: note: declarations in dependent base ‘std::map, std::allocator > >’ are not found by unqualified lookup
linkstate/ls.h:137:20: note: use ‘this->erase’ instead
make: *** [linkstate/ls.o] Error 1
Ns make failed!
解决方法:
将 ns/ns-2.35/linkstate/ls.h中的137行void eraseAll() { erase(baseMap::begin(), baseMap::end()); }改为 void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }
然后重新执行 sudo ./install
几分钟后出现下图,表明安装好了
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/mingyong/ns/otcl-1.14:/home/mingyong/ns/lib"
export TCL_LIBRARY="$TCL_LIBRARY:/home/mingyong/ns/tcl8.5.10/library"
8 新开启一个终端,输入ns,出现如下图表面安装成功,也可以进入 ns/ns-2.35, 输入./validate进行验证
ubuntu下安装ns2详细步骤