[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] Installation problem part deux (snprintf)



nader,
  yes, i did type ./configure. however on closer inspection i realized that 
configure was bailing out prematurely because my earlier installation of 
2.1b5 was incorrect! so that problem is resolved. but then i had a problem 
installing on Sun...

  installing ns-allinone-2.1b6 on a Sun m/c (SunOS 5.7), 'make' in the 
ns-2.1b6 directory complained about 'snprintf' being redeclared differently 
in config.h. the declaration in the system /usr/include/stdio.h file is:
    extern int snprintf(char *, size_t, const char *, ...);

so in config.h i changed the second parameter from int to size_t as follows 
:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// Declare our implementation of snprintf() so that ns etc. can use it.
#ifndef HAVE_SNPRINTF
#if defined(__cplusplus)
extern "C" {
#endif
/*      extern int snprintf(char *buf, int size, const char *fmt, ...); */
        extern int snprintf(char *buf, size_t size, const char *fmt, ...);
#if defined(__cplusplus)
}
#endif
#endif
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

although the installation proceeded smoothly after i edited config.h,
i'm thinking the 'configure' step should have ensured that HAVE_SNPRINTF is 
#defined when my system has it?
  i didn't see this problem reported in the 'installation problems' webpage 
and yet i don't think it could be a peculiarity of my Sun
workstation.

thanks,
neeraj

>Neeraj,
>
>Which "configure" did you use?  Did you type ./configure?
>
>Nader
>
>Neeraj Poojary writes:
> > hi all,
> >   i tried installing ns-src-2.1b6 (Jan 19) under an existing
> > ns-allinone-2.1b5 installation as follows:
> > 1> cd ns-allinone-2.1b5 ; tar xvf ../ns-src-2.1b6.tar
> > 2> cd ns-2.1b6; configure --enable-shared
> > 3> make
> >
> > i get the following error
> > =================================================================
> > $ make
> > c++ -c -g -Wall -DNO_TK -DTCLCL_CLASSINSTVAR  -DNDEBUG -DUSE_SHM
> > -DHAVE_LIBTCLCL1_0B8 -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_0A4 -DHAVE_OTCL_H
> > -DHAVE_LIBTK8_0 -DHAVE_TK_H -DHAVE_LIBTCL8_0 -DHAVE_TCL_H   
>-DSTDC_HEADERS=1
> > -DHAVE_STRING_H=1 -DHAVE_TCL_H=1 -DHAVE_LIBTCL8_0=1 -DHAVE_TK_H=1
> > -DHAVE_LIBTK8_0=1 -DHAVE_OTCL_H=1 -DHAVE_LIBOTCL1_0A4=1 -DHAVE_TCLCL_H=1
> > -DHAVE_LIBTCLCL1_0B8=1 -DHAVE_GETRUSAGE=1 -DHAVE_SBRK=1 -DHAVE_STRTOQ=1  
>-I.
> > -I../tclcl-1.0b8 -I../otcl-1.0a4
> > -I/usr/users/npoojary/ns-allinone-2.1b5/ns-2.1b6/../tk8.0.4/generic
> > -I../tcl8.0.4/generic  -o random.o random.cc
> > In file included from random.cc:40:
> > config.h:54: autoconf.h: No such file or directory
> > make: *** [random.o] Error 1
> > ====================================================================
> >
> > the following autoconf* files exist under ns-2.1b6:
> > autoconf-win32.h
> > autoconf.h.in
> > tcl/lib/{ns-autoconf.tcl, ns-autoconf.tcl.in}
> >
> > ... but no autoconf.h! my timid-newbie-guess is 'configure' normally 
>creates
> > an autoconf.h from autoconf.h.in but for some reason, it
> > did not this time. i'm running linux on a PC. did i miss a step/go wrong
> > somewhere in the installation procedure? can i simply 'cp autoconf.h.in
> > autoconf.h'? please let me know if you have any ideas.
> >
> > thanks,
> > neeraj
> > ______________________________________________________
> > Get Your Private, Free Email at http://www.hotmail.com
> >

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com