Network Simulator 2 (ns-2) のインストール | monoのブログ

monoのブログ

ブログの説明を入力します。

ns-2は、無料で使用することができるネットワークシミュレータ。

これを使うことで、ネットワークの様々な特性を解析することができる。(例えば、グラフ理論や待ち行列の新しい手法の解析など)

以下は、ns-2をインストールする際に遭遇するエラーを取り上げる。と言っても、必要なパッケージがインストールされてない等のエラーなので、多かれ少なかれはご了承を…

Debian Wheezy (7.0)
ns-2.35

1.libx11-dev
./ns-allinone-2.35/tk8.5.10/unix/../generic/tk.h:76:23: fatal error: X11/Xlib.h: そのようなファイルやディレクトリはありません
compilation terminated.
make: *** [tk3d.o] エラー 1
tk8.5.10 make failed! Exiting ...
For problems with Tcl/Tk see http://www.scriptics.com

こんなエラーが出たらlibx11-devが入っていないので、以下のコマンドでインストールする。
aptitude install libx11-dev


2. X Window System development library
checking for X11 header files
can't find X includes
otcl-1.14 configuration failed! Exiting ...
Please check http://www.isi.edu/nsnam/ns/ns-problems.html

Xウィンドウシステムの開発環境に必要なライブラリがないため、以下のコマンドでインストールする。
aptitude install xorg-dev


3.プログラムの改良
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] エラー 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

以下を参考に、プログラムを変更する。
ns-allinone-2.35/ns-2.35/linkstate/ls.h を開き
137行目の
void eraseAll() { erase(baseMap::begin(), baseMap::end()); }

void eraseAll() { this->erase(baseMap::begin(), baseMap::end()); }
に変更する。