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

Re: ns 2.1b3 problems



John:

When compiling on Solaris, I have also had trouble with snprintf.
The error message said something like "snprintf must have a prototype".
My "fix" for that was to copy the protocyupe from Tcl2.cc to Tcl.cc.
Would that cause any trouble?

Actually,  I have
come across several errors, and am still trying to fix the code.

Here are some errors, I am trying to fix presently.
These errors occur in ns-2/mem-trace.h

"mem-trace.h", line 44: Error: cur_stack(MemInfo*) is expected to return a value.

"mem-trace.h", line 49: Error: cur_heap(MemInfo*) is expected to return a value.

"mem-trace.h", line 55: Error: The function getrusage must have a prototype.

There were other errors, which I have fixed (hopefully) - I have serious
concern about my first fix below - any suggestions on other ways to fix this
bug would help.

(*) in ns-2/rng.cc

    Errors:

    "rng.cc", line 56: Error: Only one of a set of overloaded functions can be "
C" or "Pascal".
    "rng.cc", line 58: Error: Only one of a set of overloaded functions can be "
C" or "Pascal".

     Fix:

      In rng.cc, commented out the prototypes for atoi and
      gettimeofday, within #if defined(sun) ...
      
      I have serious doubts about the above "fix"
      -------------------------------------------

(*) in TclCl/tracedvar.cc 
  
  Errors:

  "tracedvar.cc", line 73: Error: "TracedInt::assign(int)" was previously declar
ed "TracedInt::assign(const int)".
  "tracedvar.cc", line 99: Error: "TracedDouble::assign(double)" was previously
declared "TracedDouble::assign(const double)".

   Fix:

    Change assign procedure declarations on lines 72 and 99 to add
    const to the parameter type.

(*) in ns-2/random.cc"

    Error:   line 48: Error: random() is expected to return a value.
    Fix:     added a return(0) after abort()


Any suggestions would help (should I switch to a more lenient compiler?)
- nitin




  >> X-url: http://www.isi.edu/~johnh/
  >> To: [email protected]
  >> Cc: [email protected], [email protected]
  >> Subject: Re: ns 2.1b3 problems 
  >> Date: Thu, 16 Jul 1998 15:46:22 -0700
  >> From: John Heidemann <[email protected]>
  >> 
  >> On Thu, 16 Jul 1998 14:54:06 PDT, Dennis Connors wrote: 
  >> >I am attempting to run ns-2.1b3.  When I run it from c-shell I get:
  >> >...
  >> >Segmentation fault (core dumped)
  >> >ariel{connors}#109:
  >> >
  >> >When I run it from GBD I get the following:
  >> >
  >> >GDB 4.16 (sparc-sun-solaris2.5), Copyright 1996 Free Software
  >> >...
  >> >(gdb) run
  >> >Starting program: /home/dangle/connors/sim-tools/bin/ns-2.1b3
  >> >../../simple.tcl
  >> >ld.so.1: /home/dangle/connors/sim-tools/bin/ns-2.1b3: fatal: relocation
  >> >error: symbol not found: snprintf: referenced in
  >> >/home/dangle/connors/sim-tools/bin/ns-2.1b3
  >> >...
  >> >I recompiled with "-lc" since this is the library which contains
  >> >"snprintf()" .
  >> 
  >> All programs get -lc automatically, so this change didn't do anything.
  >> 
  >> nm on libc.{a,so} on a Solaris 2.5.1 system suggests to me that
  >> Solaris' libc does *not* have a snprintf function, just __snprintf.
  >> 
  >> snprintf is used in tclcl.  Autoconf should detect its presence or
  >> absence and use our version (in Tcl2.cc) if necessary.  Sadly, this
  >> process seems to have failed for you.
  >> 
  >> As a work-around, remove HAVE_SNPRINTF from tclcl's makefile and
  >> rebuild.  If you can take a little more effort and let me know why
  >> tclcl's configure failed to detect a missing snprintf, though, that'd
  >> be helpful.
  >> 
  >> I would guess that there's something odd about your particular build
  >> environemnt since Solaris was one of our test platforms (and autoconf
  >> failed).
  >> 
  >>    -John Heidemann