Primeiro: use o link ns-allinone-2.35_gcc482.tar.gz
link atualizado em outubro de 2014. o ano de 2011 ns-allinone-2.35.tar.gz é para g ++ - 4.4.
O Ubuntu g ++ - 6 não está funcionando com o ns2. Por favor, faça: $ sudo apt install g++-4.9
(Ocasionalmente também vimos problemas com o Ubuntu g ++ - 5.)
E, em seguida, use este comando de compilação: $ export CC=gcc-4.9 CXX=g++-4.9 && ./install