Question

i'm trying to install ns2 in my ubuntu 13.10 with the ns-allinone-2.35.tar.gz package.

at first i was getting x11/* directory not found errors. after following some tutorial and installing following tools, helped me overcome those problems.

sudo apt-fast install tcl8.5-dev tk8.5-dev
sudo apt-fast install build-essential autoconf automake
sudo apt-fast install perl xgraph libxt-dev libx11-dev libxmu-dev
sudo apt-fast install xorg-dev g++ xgraph

however, now i'm getting the following error:

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 make failed!

this is the 5th day i'm trying to install and failed. after getting irritated while installing in windows 7 with Cygwin due to so much dependencies, now i'm trying in ubuntu but getting such errors.

how to resolve this?

Was it helpful?

Solution

i've to edit the line number 137 of ns-2.35/linkstate/ls.h from

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

to

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

and my ns2 installation is a success. however inside kali-linux. in ubuntu, though i set the path correctly and it showed the message that nam installed successfully, nam is not working and showing error that it's not installed.

if you want to validate, it'll show some fails. you can correct them by installing libperl4-corelibs-perl using

sudo apt-get install libperl4-corelibs-perl

or if you have apt-fast installed then

sudo apt-fast install libperl4-corelibs-perl

if anyone can help me with the nam installation problem in ubuntu. it'll be usefull.

OTHER TIPS

No need to edit any source code. Just use an older version of gcc and everything should work fine.

Before installing, do

export CC=gcc-4.4 CXX=g++-4.4

If you don't have these older versions, use

sudo apt-get install gcc-4.4 g++-4.4

I encountered the same errors as you did in installing ns2. Changing the source code helped !

Firstly validate using following steps: 1) Open up a terminal and move to the directory '/home/user_name/Documents/ns-allinone-2.35/ns-2.35/' and run (replace user_name with your username):

./validate

2) If the problem still persists then copy the 'nam' file from your '/home/[username]/ns-allinone-2.35/nam-1.15' folder and paste it into '/usr/local/bin' folder.

Reference : How to install NS2

Someone there mentioned in the comments about having a problem with NAM files. Try the steps given there :) Try cross checking the other steps too if need be.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top