how to solve this error....

831 views
Skip to first unread message

mahe

unread,
Oct 1, 2013, 10:37:25 AM10/1/13
to ns-u...@googlegroups.com
Hi friends.. anybody tell me how to solve this error...

tk8.4.13 installation succeeded.
============================================================
* Build OTcl-1.12
============================================================
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... 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 ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking for egrep... 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 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 standard STL is available... no
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.11... 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 X11 header files
checking for X11 library archive
checking for XOpenDisplay in -lX11... yes
checking for XShmAttach in -lXext... yes
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking system version (for dynamic loading)... Linux-3.5.0-23-generic
No explicit static compilation flag; setting V_STATIC to ""
checking for dlopen in -ldl... yes
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
rm -f libotcl.so otcl.o so_locations
gcc-4.6 -c -g -O2 -DNDEBUG -DUSE_SHM -fpic -I. -I/home/hems/Aquasim/include -I/home/hems/Aquasim/include -I/home/hems/Aquasim/include -I/include  otcl.c
ld -shared -o libotcl.so otcl.o
otcl.o: In function `OTclDispatch':
/home/hems/Aquasim/otcl-1.12/otcl.c:495: undefined reference to `__stack_chk_fail_local'
otcl.o: In function `Otcl_Init':
/home/hems/Aquasim/otcl-1.12/otcl.c:2284: undefined reference to `__stack_chk_fail_local'
ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Bad value
make: *** [libotcl.so] Error 1
otcl-1.12 make failed! Exiting ...
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

Selman HIZAL

unread,
Dec 4, 2013, 3:58:01 PM12/4/13
to ns-u...@googlegroups.com
http://ramakrishnamundugar.blogspot.com/2012_09_01_archive.html

NS-2.34 installation in Ubuntu 12.04

Follow the below given steps:

  • Download ns-allinnone-2.34 from nasam website
             http://sourceforge.net/projects/nsnam/files/ns-2
  • Create a folder in home with name ns2
  •  Extract the tar file in ns2 
  • Open terminal and type cd ns2/ns-allinone-2.34
  •  Install required libraries for ns2 using terminal
            sudo apt-get install build-essential autoconf automake libxmu-dev
  •  Then, sudo ./install

For errors,


1.
ld: libotcl.so: hidden symbol `__stack_chk_fail_local' isn't defined
ld: final link failed: Bad value
make: *** [libotcl.so] Error 1
otcl-1.13 make failed! Exiting ... Solution:
In otcl-1.13/configure, line number 6304

-SHLIB_LD="ld -shared"
+SHLIB_LD="gcc -shared"

2.
tools/ranvar.cc: In member function ‘virtual double GammaRandomVariable::value()’:
tools/ranvar.cc:219:70: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly [-fpermissive]
tools/ranvar.cc:219:70: error:   for a function-style cast, remove the redundant ‘::GammaRandomVariable’ [-fpermissive]
make: *** [tools/ranvar.o] Error 1


Solution:
In ns-2.34/tools/ranvar.cc, line 219

-return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
+return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);

3.
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!


Solution:
In mac/mac-802_Ext.h, line 65

+#include<cstddef>

4.
mobile/nakagami.cc: In member function ‘virtual double Nakagami::Pr(PacketStamp*, PacketStamp*, WirelessPhy*)’:
mobile/nakagami.cc:183:73: error: cannot call constructor ‘ErlangRandomVariable::ErlangRandomVariable’ directly [-fpermissive]
mobile/nakagami.cc:183:73: error:   for a function-style cast, remove the redundant ‘::ErlangRandomVariable’ [-fpermissive]
mobile/nakagami.cc:185:67: error: cannot call constructor ‘GammaRandomVariable::GammaRandomVariable’ directly [-fpermissive]
mobile/nakagami.cc:185:67: error:   for a function-style cast, remove the redundant ‘::GammaRandomVariable’ [-fpermissive]
make: *** [mobile/nakagami.o] Error 1


Solution:
In ns-2.34/mobile/nakagami.cc, Line no.

-if (int_m == m) {
-             resultPower = ErlangRandomVariable::ErlangRandomVariable(Pr/m, int_m).value();
-         } else {
-             resultPower = GammaRandomVariable::GammaRandomVariable(m, Pr/m).value();
-         }
-         return resultPower;
-    }


 +if (int_m == m) {
 +           resultPower = ErlangRandomVariable(Pr/m, int_m).value();
 +        } else {
 +            resultPower = GammaRandomVariable(m, Pr/m).value();
 +        }
 +       return resultPower;
 +   }


Path Setup:
  • In terminal sudo gedit ~/.bash_aliases 
  • Then copy the following path and modify according to your system path

# LD_LIBRARY_PATH
OTCL_LIB=/home/ramakrishna/ns2/ns-allinone-2.34/otcl-1.13
NS2_LIB=/home/ramakrishna/ns2/ns-allinone-2.34/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/home/ramakrishna/ns2/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/ramakrishna/ns2/ns-allinone-2.34/bin:/home/ramakrishna/ns2/ns-allinone-2.34/tcl8.4.18/unix:/home/ramakrishna/ns2/ns-allinone-2.34/tk8.4.18/unix
NS=/home/ramakrishna/ns2/ns-allinone-2.34/ns-2.34/
NAM=/home/ramakrishna/ns2/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$XGRAPH:$NS:$NAM


  • Save the file and type source ~/.bash_aliases
 Now if you type ns in terminal it will show % symbol

Reply all
Reply to author
Forward
0 new messages