ls.cc文件错误?

时间:2014-09-17 11:48:33

标签: ns2

安装时我遇到了错误

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: error: ‘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: 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失败了!

我正在研究NS2项目。对安装感到震惊 请帮忙

2 个答案:

答案 0 :(得分:4)

ns-2.xx/linkstate目录中打开文件ls.cc(在我的例子中,它是ls.h)。改变第137行即。如下

    void eraseAll() { erase(baseMap::begin(), baseMap::end()); }

    void eraseAll() {baseMap::erase(baseMap::begin(), baseMap::end()); }

答案 1 :(得分:1)

它很简单。你需要改变&#34;擦除&#34; to&#34; this-&gt; erase&#34;在linkstate / ls.h:137:58文件中。然后再次尝试安装。