First, do the same things as you would do for the ns-2.34 and Ubuntu 10.10 installation, i.e.:
Install the development files for X Windows plus the g++ compiler:
sudo apt-get install xorg-dev g++ xgraph
Fix the error in the linking of otcl by editing line 6304 of otcl-1.13/configure so that it reads
SHLIB_LD="gcc -shared"
instead of
SHLIB_LD="ld -shared"
Then, edit the file ns-2.34/tools/ranvar.cc and change the line 219 from
return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
to
return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
Next, change the lines 183 and 185 in file ns-2.34/mobile/nakagami.cc to read
resultPower = ErlangRandomVariable(Pr/m, int_m).value();
and
resultPower = GammaRandomVariable(m, Pr/m).value();
Now the code will compile if you run ./install. However, you may not be able to run the ns executable. If you get an error stating that there has been a buffer overflow *** buffer overflow detected ***: ./ns terminated including a backtrace, you need to do the following to make it work:
Install gcc-4.4 and g++-4.4 including dependencies using the code below:
$ sudo apt-get install gcc-4.4 g++-4.4
Change the line 270 in tcl8.4.18/unix/Makefile.in that reads
CC = @CC@
so it appends the version parameter for version 4.4:
CC = @CC@ -V 4.4
Make sure it is a capital V.
Finally, run ./install from the ns-allinone-2.34 top folder again.
Excellent post Erlend!
I have gone through the first two steps (using other older forum posts), but then I got the buffer overflow error and found this post. Totally works!
Yara
One more thing, I was getting the error in the installation scenario of this thread, which read:
In file included from mac/mac-802_11Ext.cc:66:0:
mac/mac-802_11Ext.h: In member function ‘u_int32_t PHY_MIBExt::getHdrLen11()’:
mac/mac-802_11Ext.h:175:19: error: expected primary-expression before ‘struct’
mac/mac-802_11Ext.h:175:41: error: ‘dh_body’ was not declared in this scope
mac/mac-802_11Ext.h:175:51: error: ‘offsetof’ was not declared in this scope
mac/mac-802_11Ext.h:177:3: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [mac/mac-802_11Ext.o] Error 1
Ns make failed!
So, I just fixed it by adding the line
#include
to the header of the file: ns-allinone-2.34\ns-2.34\mac\mac-802_11Ext.h
and then ns2.34 installed well…
I guess you meant to add that line to the file: mac/mac-802_11Ext.h
what should I write after the word “#include” ?
I don’t see any name of a file to include..
if you meant to include mac-802_11.h, then the duplicated classes like rts_frame, cts_frame et cetra should be commented in file: mac-802_11Ext.h and then it will work.
Thanks!
disculpa soy nuevo en el tema, estoy instalando el ns-2.34 en Ubuntu 12.04 y tengo el mismo error pero no entiendo: agrego #include “???” al archivo mac-802_11Ext.h que nombre de archivo coloco en “???” y en que linea, gracias por tu ayuda
Excelente información te agradezco mucho, yo trabajo ns-2 y actualmente estoy desarrollando la tesis sobre protocolos de enrutamiento y tu información ha sido muy valiosa gracias
Gracias por las bonitas palabras, Roberto!
It worked thank you loads
Totally works, thanks!
Has anyone had issues with NAM in 11.04? I get a Buffer Overflow Detected error and the backtrace lists:
/lib/x86_64-linux-gnu/libc.so.6
According to this post:
http://www.streamreader.org/askubuntu/questions/40416/why-is-lib-libc-so-6-missing
libc.so was moved in 11.04 and I’m wondering if this is causing the problem, but I don’t know enough about Ubuntu to fix this problem.
Any advice would be great.
and to add further confusion, when I run ./validate on NAM, it runs and instances of NAM open and run, but as soon as I try to run NAM on its own, it gives me the buffer overflow error.
Did you follow the instructions closely? Especially the ones starting with ‘Install gcc-4.4 and g++-4.4 including…’
It might help.
yep, ive got gcc/g++ v. 4.4.5.2 with generic library support and multilib files. nam doesnt have any problems running during the validation tests, its only when I run it from a simulation .tcl script. makes no sense to me.
if your problem is just with nam, try using the one provided by ubuntu:
sudo apt-get install nam
It’s excellent work Erlend’s. You did very good job. I installed with your absolute guide.
Thanks. Keep it up.
Thanes
masih eroo,.pada otcl nya,…gimn tu??,.
Excellent thanks….
Pingback: John's not home
Pingback: Installing Network Simulator 2 (NS2.34) in Ubuntu 11.04 | Pradeepkumar.org
Hi Erlend,
I used your tips for installing ns2.34 on ubuntu 11.04, but stuck at the buffer overflow error. I sent you an email enclosing the logs. I’ll really appreciate it if you could help me for some more tips. The case is curious. Thank you very much.
Hi Erland
I am following all the steps as mentioned in the blog for installing ns2.34 and yet i am getting BUFFER OVERFLOW ERROR. Default version of gcc in ububtu 11.04 is 4.5.2 and that required for ns2 is gcc4.4. The command “sudo apt-get install gcc-4.4″ doesn’t install it and neither it can be installed from Synaptic Package Manager.
Please guide me in the process to installing the same.
Thanks in advance
I’m sorry, but I don’t know why you aren’t able to install gcc-4.4 through Synaptic. I will repeat the advice I gave to Chang who commented a few hours before you, for the record. Hope you can use it…:
“From your installlog.log it seems the g++ compiler is not installed. You could do this using the command sudo apt-get install xorg-dev g++ xgraph And then it is important to install the version 4.4 of the compilers. Also remember to run the ns binary by using the full path, so that you don’t mistakenly run an earlier installed version from the /usr/bin or similar directory.”
Cheers, Erlend
Thanks for making my life easier with these kind of posts!
Pingback: facing ns2 installation issues in ubuntu 11.04
I have installed and done modifications in the files as posted above
.env output shows
LD_LIBRARY_PATH=:/home/padma/ns-allinone-2.34/otcl-1.13:/home/padma/ns-allinone-2.34/lib:/usr/X11R6/lib:/usr/local/lib:/home/padma/ns-allinone-2.34/otcl-1.13:/home/padma/ns-allinone-2.34/lib:/usr/X11R6/lib:/usr/local/lib:/home/padma/ns-allinone-2.34/otcl-1.13:/home/padma/ns-allinone-2.34/lib:/usr/X11R6/lib:/usr/local/lib
All other variables have also been set.
On doing ns i get the % prompt and exits properly but when I run ./validate i get the following result
(Validation can take 1-30 hours to run.)
Thu Sep 1 21:59:04 IST 2011
*** ./test-all-simple
Tests: tahoe1 tahoe1Bytes tahoe1RED tahoe1REDbytes tahoe2 tahoe3 tahoe3RED tahoe4 no_bug bug reno1 reno renoA reno2 reno3 reno4 reno4a reno5 reno5_nobug telnet delayed phase phase1 phase2 timers manyflows stats statsECN stats1 stats1Bytes stats1a stats1aBytes statsHeaders stats2 stats3 stats4 statsTFRC
Running test tahoe1:
../../ns test-suite-simple.tcl tahoe1 QUIET
./test-all-template1: 149: ../../ns: not found
Running test tahoe1Bytes:
../../ns test-suite-simple.tcl tahoe1Bytes QUIET
./test-all-template1: 149: ../../ns: not found
How to go ahead?
Thanks so much for this excellent guide. Helped me to overcome all my problems I had when installing ns2 on Ubuntu 11.04
I have a problem. I have installed ns2 through Ubuntu Software Center because I couldn’t install with Terminal. It was impossible for me
Now I have to install a patch for RSVP and I don’t know how. In all the tutorials I have saw, they go to the folder of ns2 and continue with the installation.
The problem is that I don’t have a ns2 folder, all the files are spread in several folders.
I don’t know what I have to do to install a patch in this case.
Can somebody help me please?
Send an email java1652_anva@hotmail.com
Hi Erlend,
I assume the above solution is for Ubuntu 11.04 32bits.
Because …
When I ran ns (ns2.34) after a successful installation over my Ubuntu 11.04 I get ”Segmentation fault”.
I have heard from experts that ns2.xx does not run on Ubuntu 11.04 64bit but do on 32bit.
Any updates or fixes …
Debugging says:
amro@mohammadamro:~/simu/ns-allinone-2.34-plain$ gdb ns
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “x86_64-linux-gnu”.
For bug reporting instructions, please see:
…
Reading symbols from /home/amro/simu/ns2.34-eurane-svn/bin/ns…done.
(gdb) run
Starting program: /home/amro/simu/ns2.34-eurane-svn/bin/ns
[Thread debugging using libthread_db enabled]
Program received signal SIGSEGV, Segmentation fault.
0×0000000000860911 in OTclODestroyMethod (cd=, in=0xd29f10, argc=4, argv=0x7fffffffb000) at otcl.c:1305
1305 otcl.c: No such file or directory.
in otcl.c
(gdb) next
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
Thanks for your support.
BR,
MAMRO
Pingback: Installing NS2 in Ubuntu 11.04 « Narendran's Chronicles
Hi erlend
its seems to be nice article but im facing below error while installing ns2 in ubuntu 11.04
please help me
gcc -V 4.4 -O2 -pipe -DTCL_DBGX= -Wl,–export-dynamic tclAppInit.o -L/home/manpreet/ns-allinone-2.34/tcl8.4.18/unix -ltcl8.4 -ldl -lieee -lm \
-Wl,-rpath,/home/manpreet/ns-allinone-2.34/lib -o tclsh
tcl8.4.18 make succeeded.
Warning: tclStubInit.c may be out of date.
Developers may want to run “make genstubs” to regenerate.
This warning can be safely ignored, do not report as a bug!
Installing libtcl8.4.a to /home/manpreet/ns-allinone-2.34/lib/
cp: cannot create regular file `/home/manpreet/ns-allinone-2.34/lib/#inst.11121#’: Permission denied
rm: cannot remove `/home/manpreet/ns-allinone-2.34/lib/libtcl8.4.a’: Permission denied
mv: cannot stat `/home/manpreet/ns-allinone-2.34/lib/#inst.11121#’: No such file or directory
ranlib: could not create temporary file whilst writing archive: No more archived files
make: *** [install-binaries] Error 1
tcl8.4.18 installation failed.
Tcl is not part of the ns project. Please see http://www.Scriptics.com
to see if they have a fix for your platform.
manpreet@manpreet-vaio:~/ns-allinone-2.34$ %
Thank you very very much for your good comments
Thanks a lot for your comments. It was very useful indeed
thanks, your post save my times
Pingback: Installing ns-2.34 on Ubuntu 11.10 Oneiric Ocelot « Erlend's Lookout Post
Hi Erlend
After changing the files with the requested still i m not abling to install i got the following error
In file included from mac/mac-802_11Ext.cc:66:0:
mac/mac-802_11Ext.h: In member function ‘u_int32_t PHY_MIBExt::getHdrLen11()’:
mac/mac-802_11Ext.h:175:19: error: expected primary-expression before ‘struct’
mac/mac-802_11Ext.h:175:41: error: ‘dh_body’ was not declared in this scope
mac/mac-802_11Ext.h:175:51: error: ‘offsetof’ was not declared in this scope
mac/mac-802_11Ext.h:177:3: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [mac/mac-802_11Ext.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems
can provide any solutions to this?
Have you tried the additional changes required for Ubuntu 11.10, as described here: http://erl1.wordpress.com/2011/10/14/installing-ns-2-34-on-ubuntu-11-10-oneiric-ocelot/
In particular:
Add a line after line 64 in ns-2.34/mac/mac-802_11Ext.h to read:
#include <stddef.h>
Good luck!
THANK U VERY MUCH i have installed ns2.34 in ubuntu 12.04
hello sir ,
i have problem while exc ./configure comand and make
umesha@umesha-Lenovo-B460:~/yashu/ns-allinone-2.34/ns-2.34$ ./configure
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking how to run the C preprocessor… gcc -E
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking minix/config.h usability… no
checking minix/config.h presence… no
checking for minix/config.h… no
checking whether it is safe to define __EXTENSIONS__… yes
No .configure file found in current directory
Continuing with default options…
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking target system type… i686-pc-linux-gnu
checking for gcc… (cached) gcc
checking whether we are using the GNU C compiler… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for gcc option to accept ISO C89… (cached) none needed
checking for g++… g++
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking for ANSI C header files… (cached) yes
checking for string.h… (cached) yes
checking for main in -lXbsd… no
checking for socket in -lsocket… no
checking for gethostbyname in -lnsl… yes
checking for dcgettext in -lintl… no
checking for getnodebyname in -ldnet_stub… no
checking that g++ can handle -O2… no
checking if C++ libraries work without any namespace… no
checking if C++ libraries work with namespace std… yes
checking if STL works without any namespace… no
checking if STL works with namespace std… yes
checking should use STL… yes
checking for tcl.h… -I../include
checking for tclInt.h… -I../include
checking for libtcl8.4… -L../lib -ltcl8.4
checking for init.tcl… ../lib/tcl8.4
checking for http.tcl… ../lib/tcl8.4/http1.0
checking Tcl http.tcl library… yes
checking for tclsh8.4.18… no
checking for tclsh8.4… ../bin/tclsh8.4
checking for tk.h… -I../include
checking for libtk8.4… -L../lib -ltk8.4
checking for tk.tcl… ../lib/tk8.4
checking for otcl.h… -I../otcl-1.13
checking for libotcl1.13… no
configure: error: Installation of otcl seems incomplete or can’t be found automatically.
Please correct the problem by telling configure where otcl is
using the argument –with-otcl=/path/to/package
(perhaps after installing it),
or the package is not required, disable it with –with-otcl=no.
umesha@umesha-Lenovo-B460:~/yashu/ns-allinone-2.34/ns-2.34$ ./configure
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking how to run the C preprocessor… gcc -E
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/grep -E
checking for ANSI C header files… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking minix/config.h usability… no
checking minix/config.h presence… no
checking for minix/config.h… no
checking whether it is safe to define __EXTENSIONS__… yes
No .configure file found in current directory
Continuing with default options…
checking build system type… i686-pc-linux-gnu
checking host system type… i686-pc-linux-gnu
checking target system type… i686-pc-linux-gnu
checking for gcc… (cached) gcc
checking whether we are using the GNU C compiler… (cached) yes
checking whether gcc accepts -g… (cached) yes
checking for gcc option to accept ISO C89… (cached) none needed
checking for g++… g++
checking whether we are using the GNU C++ compiler… yes
checking whether g++ accepts -g… yes
checking for ANSI C header files… (cached) yes
checking for string.h… (cached) yes
checking for main in -lXbsd… no
checking for socket in -lsocket… no
checking for gethostbyname in -lnsl… yes
checking for dcgettext in -lintl… no
checking for getnodebyname in -ldnet_stub… no
checking that g++ can handle -O2… no
checking if C++ libraries work without any namespace… no
checking if C++ libraries work with namespace std… yes
checking if STL works without any namespace… no
checking if STL works with namespace std… yes
checking should use STL… yes
checking for tcl.h… -I../include
checking for tclInt.h… -I../include
checking for libtcl8.4… -L../lib -ltcl8.4
checking for init.tcl… ../lib/tcl8.4
checking for http.tcl… ../lib/tcl8.4/http1.0
checking Tcl http.tcl library… yes
checking for tclsh8.4.18… no
checking for tclsh8.4… ../bin/tclsh8.4
checking for tk.h… -I../include
checking for libtk8.4… -L../lib -ltk8.4
checking for tk.tcl… ../lib/tk8.4
checking for otcl.h… -I../otcl-1.13
checking for libotcl1.13… no
configure: error: Installation of otcl seems incomplete or can’t be found automatically.
Please correct the problem by telling configure where otcl is
using the argument –with-otcl=/path/to/package
(perhaps after installing it),
or the package is not required, disable it with –with-otcl=no.
umesha@umesha-Lenovo-B460:~/yashu/ns-allinone-2.34/ns-2.34$
hi,
I try to install ns2.34 on 11.04, and I follow all the above steps but I have buffer overflow yet!
do you have any idea about that?
It could be that you are running Ubuntu 64 bit? Rumor has it that ns-2 will not work with Ubuntu 11.04 64 bit in any case. I cannot confirm or disprove this, as I lack the hardware.
no, I download ubuntu 32 bit and install that. my hardware is 32 bit too.
thanks for reply!
hi
it worked!
thank you Erlend.
Hi… I am trying to install Otcl-1.14 on ubuntu and I am getting below error after I run ./configure command…
checking for libtcl8.5… -L/usr/local/lib -ltcl8.5
checking for init.tcl… /usr/share/tcl8.5
checking for http.tcl… /usr/share/tcl8.5/http1.0
checking Tcl http.tcl library… yes
checking for tclsh8.5.10… no
checking for tclsh8.5… /usr/local/bin/tclsh8.5
configure: error: Installation of tcl seems incomplete or can’t be found automatically.
Please correct the problem by telling configure where tcl is
using the argument –with-tcl=/path/to/package
(perhaps after installing it),
or the package is not required, disable it with –with-tcl=no.
I already have installed NS-2.34 on ubuntu and it is working fine, do I still need to install Otcl?
Thanks in advance!
-Jay
HI!!
I got the reference to this page from the ‘nsnam’ website, which was showing how to install NS2.34 on Ubuntu 11.04!
Thank you so much for putting up this content!
HI!!
Thank you soooooooo much for putting up this content!
Finally I got NS2.34 installed on Ubuntu 11.04 with much help from here and there.
Thanks a lot for document….
It helped me a lot for successful installation ns2 ..
* Build Stanford GraphBase
============================================================
Making sgb
gcc34 -g -I/usr/local/sgb/include -DDATA_DIRECTORY=\”/usr/local/sgb/data/\” -c gb_io.c
make: gcc34: Command not found
make: *** [gb_io.o] Error 127
Unable to create sgb library, but it’s optional, so continuing…
============================================================
* Build GT-ITM
============================================================
sgb lib not found. gt-itm & sgb2ns could not be installed. Continuing..
============================================================
* Build zlib
============================================================
Building static library libz.a version 1.2.3 with gcc34.
Checking for unistd.h… No.
Checking whether to use vs[n]printf() or s[n]printf()… using s[n]printf()
Checking for snprintf() in stdio.h… No.
WARNING: snprintf() not found, falling back to sprintf(). zlib
can build but will be open to possible buffer-overflow security
vulnerabilities.
Checking for return value of sprintf()… No.
WARNING: apparently sprintf() does not return a value. zlib
can build but will be open to possible string-format security
vulnerabilities.
Checking for errno.h… No.
Checking for mmap support… No.
gcc34 -O -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H -c -o example.o example.c
make: gcc34: Command not found
make: *** [example.o] Error 127
Zlib make failed, but it’s optional Continue …
============================================================
* Build tcl8.4.18
============================================================
configure: WARNING: unrecognized options: –enable-gcc
checking whether to use symlinks for manpages… no
checking whether to compress the manpages… no
checking whether to add a package name suffix for the manpages… no
checking for gcc… gcc34
checking whether the C compiler works… no
configure: error: in `/home/rajotia/ns-allinone-2.34/tcl8.4.18/unix’:
configure: error: C compiler cannot create executables
See `config.log’ for more details
tcl8.4.18 configuration failed! Exiting …
Tcl is not part of the ns project. Please see http://www.Scriptics.com
to see if they have a fix for your platform.
Dear all;
I get the following problem while installing ns-allinone-2.34 on ubuntu 11.04. Please help me ????
* Build Stanford GraphBase
============================================================
Making sgb
gcc34 -g -I/usr/local/sgb/include -DDATA_DIRECTORY=\”/usr/local/sgb/data/\” -c gb_io.c
make: gcc34: Command not found
make: *** [gb_io.o] Error 127
Unable to create sgb library, but it’s optional, so continuing…
============================================================
* Build GT-ITM
============================================================
sgb lib not found. gt-itm & sgb2ns could not be installed. Continuing..
============================================================
* Build zlib
============================================================
Building static library libz.a version 1.2.3 with gcc34.
Checking for unistd.h… No.
Checking whether to use vs[n]printf() or s[n]printf()… using s[n]printf()
Checking for snprintf() in stdio.h… No.
WARNING: snprintf() not found, falling back to sprintf(). zlib
can build but will be open to possible buffer-overflow security
vulnerabilities.
Checking for return value of sprintf()… No.
WARNING: apparently sprintf() does not return a value. zlib
can build but will be open to possible string-format security
vulnerabilities.
Checking for errno.h… No.
Checking for mmap support… No.
gcc34 -O -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H -c -o example.o example.c
make: gcc34: Command not found
make: *** [example.o] Error 127
Zlib make failed, but it’s optional Continue …
============================================================
* Build tcl8.4.18
============================================================
configure: WARNING: unrecognized options: –enable-gcc
checking whether to use symlinks for manpages… no
checking whether to compress the manpages… no
checking whether to add a package name suffix for the manpages… no
checking for gcc… gcc34
checking whether the C compiler works… no
configure: error: in `/home/rajotia/ns-allinone-2.34/tcl8.4.18/unix’:
configure: error: C compiler cannot create executables
See `config.log’ for more details
tcl8.4.18 configuration failed! Exiting …
Tcl is not part of the ns project. Please see http://www.Scriptics.com
to see if they have a fix for your platform.
Pingback: NS2
Pingback: Install ns-allinone-2.34 on Ubuntu 11.10 « wmyaoyao
hi
after doing the steps, i get this problem
root@ubuntu:/home/krimou/ns-allinone-2.34# ./install
bash: ./install: No such file or directory
thanks for all
HI! Just wanted to tell that you did not put the first step (viz., downloading the ‘ns-2.34 allinone’ file in the first step), though it can be seen on the link given!
Pingback: Help me please,is urgent
Pingback: Installing Network Simulator 2 (NS2.34) in Ubuntu 11.04 | Pradeepkumar.org
Pingback: Instalación de ns2 en ubuntu 11.10 | BorrowBITs
Did anyone know the reasons for the followings errors
tmix/tmix_delaybox.o: In function `Tmix_DelayBoxNodeClass::~Tmix_DelayBoxNodeClass()’:
tmix_delaybox.cc:(.text._ZN22Tmix_DelayBoxNodeClassD0Ev[Tmix_DelayBoxNodeClass::~Tmix_DelayBoxNodeClass()]+0×16): undefined reference to `TclClass::~TclClass()’
common/tclAppInit.o: In function `nslibmain’:
tclAppInit.cc:(.text+0x1c): undefined reference to `Tcl_Main’
common/tclAppInit.o: In function `Tcl_AppInit’:
tclAppInit.cc:(.text+0×74): undefined reference to `Tcl_Init’
tclAppInit.cc:(.text+0×84): undefined reference to `Otcl_Init’
tclAppInit.cc:(.text+0xc3): undefined reference to `Tcl_SetVar’
tclAppInit.cc:(.text+0xd6): undefined reference to `Tcl::init(Tcl_Interp*, char const*)’
tclAppInit.cc:(.text+0xe7): undefined reference to `EmbeddedTcl::load()’
tclAppInit.cc:(.text+0xf3): undefined reference to `EmbeddedTcl::load()’
common/tclAppInit.o: In function `abort’:
tclAppInit.cc:(.text+0x11f): undefined reference to `Tcl::evalc(char const*)’
Sir ,
Buffer overflow detected when i execute ns tcl script,
After do the modifications to my aodv,cc file i have do make clean & make commands several times.But i have detected buffer overflow..
I have no idea what should i do..
please sir help me…..
I cant do anything in ns because of this,,,,
If you want to install ns-2.34 on Ubuntu 12.04 then check this post http://amitcode.wordpress.com/
help taken from here though thanks Erlend for your help
GOTO to following link and do the steps provided in that website..
http://windows-droid.blogspot.in/2012/08/install-mannasim-patch-in-ns-234.html
Install Mannasim Patch in NS 2.34 for Wireless Sensor Network Simulation
1. Download Mannsim Patch for NS 2.34 .
2.put the mannasim patch file inside the ns-allinone-2.34 folder.
3.Type the following command on the ns-allinone-2.34 folder:
patch -p1 < ns2.34-mannasim-gcc4.3.patch
To test MannaSim installation,run the two simulation scripts are provided in the above website. The first one simulates a flat network of homogeneous sensors and the second a hierarchical network composed of two diferent classes of sensor nodes.
Flat homogeneous network TCL Script
Hierarchical heterogeneous network TCL Script
Installing ns-2.34 on Ubuntu 12.04
First, do the same things as you would do for the ns-2.34 and Ubuntu 10.10 installation, i.e.:
Install the development files for X Windows plus the g++ compiler:
sudo apt-get install xorg-dev g++ xgraph
Fix the error in the linking of otcl by editing line 6304 of otcl-1.13/configure so that it reads
SHLIB_LD="gcc -shared"
instead of
SHLIB_LD="ld -shared"
Then, edit the file ns-2.34/tools/ranvar.cc and change the line 219 from
return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
to
return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
Next, change the lines 183 and 185 in file ns-2.34/mobile/nakagami.cc to read
resultPower = ErlangRandomVariable(Pr/m, int_m).value();
and
resultPower = GammaRandomVariable(m, Pr/m).value();
Now the code will compile if you run ./install. However, you may not be able to run the ns executable. If you get an error stating that there has been a buffer overflow *** buffer overflow detected ***: ./ns terminated including a backtrace, you need to do the following to make it work:
Install gcc-4.4 and g++-4.4 including dependencies using the code below:
$ sudo apt-get install gcc-4.4 g++-4.4
Change the line 270 in tcl8.4.18/unix/Makefile.in that reads
CC = @CC@
so it appends the version parameter for version 4.4:
CC = @CC@ -V 4.4
Make sure it is a capital V.
Finally, run ./install from the ns-allinone-2.34 top folder again.
If suppose following error occurs…..
In file included from mac/mac-802_11Ext.cc:66:0:
mac/mac-802_11Ext.h: In member function ‘u_int32_t PHY_MIBExt::getHdrLen11()’:
mac/mac-802_11Ext.h:175:19: error: expected primary-expression before ‘struct’
mac/mac-802_11Ext.h:175:41: error: ‘dh_body’ was not declared in this scope
mac/mac-802_11Ext.h:175:51: error: ‘offsetof’ was not declared in this scope
mac/mac-802_11Ext.h:177:3: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [mac/mac-802_11Ext.o] Error 1
Ns make failed!
then
Add a line
#include
after line 64 in the header of the file: ns-allinone-2.34\ns-2.34\mac\mac-802_11Ext.h
and then give ./install
If suppose following error occurs
mannasim/onDemandData.o mannasim/onDemandData.cc
mannasim/onDemandData.cc: In constructor ‘OnDemandData::OnDemandData()’:
mannasim/onDemandData.cc:44:33: error: cannot call constructor ‘OnDemandData::OnDemandData’ directly [-fpermissive]
mannasim/onDemandData.cc:44:33: error: for a function-style cast, remove the redundant ‘::OnDemandData’ [-fpermissive]
make: *** [mannasim/onDemandData.o] Error 1
Ns make failed!
comment the following lines in ns-allinone-2.34\ns-2.34\mannasim\ondemanddata.cc
To comment use symbol “///”
OnDemandData :: OnDemandData()
{
REAL request type is default.
OnDemandData::OnDemandData(REAL);
}
then give ./install
Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.4.18: /home/user/Desktop/ns-allinone-2.34/{bin,include,lib}
tk8.4.18: /home/user/Desktop/ns-allinone-2.34/{bin,include,lib}
otcl: /home/user/Desktop/ns-allinone-2.34/otcl-1.13
tclcl: /home/user/Desktop/ns-allinone-2.34/tclcl-1.19
ns: /home/user/Desktop/ns-allinone-2.34/ns-2.34/ns
nam: /home/user/Desktop/ns-allinone-2.34/nam-1.14/nam
gt-itm: /home/user/Desktop/ns-allinone-2.34/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns
Please put /home/user/Desktop/ns-allinone-2.34/bin:/home/user/Desktop/ns-allinone-2.34/tcl8.4.18/unix:/home/user/Desktop/ns-allinone-2.34/tk8.4.18/unix
into your PATH environment; so that you’ll be able to run itm/tclsh/wish/xgraph.
IMPORTANT NOTICES:
(1) You MUST put /home/user/Desktop/ns-allinone-2.34/otcl-1.13, /home/user/Desktop/ns-allinone-2.34/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=
(2) You MUST put /home/user/Desktop/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.
After these steps, you can now run the ns validation suite with
cd ns-2.34; ./validate
For trouble shooting, please first read ns problems page
http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive
for related posts.
The above steps will confirm you that ns2.34 was installed successfully in ubuntu12.04
To set path for ns2.34
in terminal type following commands
cd /etc
gedit ~/.bashrc
export PATH=$PATH:/home/user/Desktop/ns-allinone-2.34/bin:/home/user/Desktop/ns-allinone-2.34/tcl8.4.18/unix:/home/user/Desktop/ns-allinone-2.34/tk8.4.18/unix;
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/Desktop/ns-allinone-2.34/otcl-1.13:/home/user/Desktop/ns-allinone-2.34/lib;
export TCL_LIBRARY=$TCL_LIBRARY:/home/user/Desktop/ns-allinone-2.34/tcl8.4.18/library;
“give above commands and save the bashrc file’
in terminal type following command
source ~/.bashrc
then type ns if “%” occurs ns2 get installed….