running Tcl-based g++ apps on a decstation/ultrix 
Author Message
 running Tcl-based g++ apps on a decstation/ultrix

Tcl gives me syntax errors on exprs of the form "!0" when a program is
compiled with g++ on decstations.
Only in this situation: if I compile on a sparc w/ g++, or use gcc to
compile on a decstation it works as expected. The version of g++ is
2.3.3 and Ultrix is 4.3.

Anyone out there with identical problems?

This is what I see: when Tcl parses

   if !0 then {puts stdout "evaluated"}

I get this output:

syntax error in expression "!0"
    while executing
"if !0 then {puts stdout "evaluated"}"

Below are the files that isolate the problem. The program is only a
simple main that creates an interp and sources a tcl file.

Note that the tcl modules are compiled w/ the machine's cc in all
cases. It is only the way modules are loaded that influences the
result.

Makefile:
------------------
# compile w/ gcc, always works
exp: main.c
        gcc -ansi -o exp -I/usr/sww/include \
                main.c \
                -L/usr/sww/lib -ltcl -lm
# compile w/ g++; does not work on decstations
exp2: main.c
        g++ -ansi -o exp2 -I/usr/sww/include\
                main.c \
                -L/usr/sww/lib -ltcl -lm

--------------------------------------------------------------------

startup.tcl
----------------
# the file w/ a Tcl script for evaluation
if !0 then {puts stdout "evaluated"}

----------------------------------------------------------------------

main.c
-----------

#include <stdio.h>
#include <stdlib.h>
#include "tcl.h"

#define startup "startup.tcl"

main(int argc, char *argv[])
{

  int result;

  char *msg;
  Tcl_Interp *interp;

  interp = Tcl_CreateInterp();

  result = Tcl_VarEval(interp, "source ", startup, (char *) NULL);

  if (result == TCL_OK)
    return 0;

  /* get the error information from the Tcl interp and print it on stderr */

  msg = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY);

  if (msg == NULL) {
    msg = interp->result;
  }

  fprintf(stderr, "%s\n", msg);
  return 1;

Quote:
}

-------------------------------------------------------


Tue, 26 Dec 1995 18:18:36 GMT  
 running Tcl-based g++ apps on a decstation/ultrix
Hello,


Quote:
>Tcl gives me syntax errors on exprs of the form "!0" when a program is
>compiled with g++ on decstations.
>Only in this situation: if I compile on a sparc w/ g++, or use gcc to
>compile on a decstation it works as expected. The version of g++ is
>2.3.3 and Ultrix is 4.3.

It seems to work as expected on my machine with gcc and g++ (and cc)
of gcc-2.4.3 / Ultrix-4.2c.

--
Kazuro Furukawa
National Laboratory for High Energy Physics (KEK), Japan



Wed, 27 Dec 1995 22:34:06 GMT  
 running Tcl-based g++ apps on a decstation/ultrix

I already found the problem. The version I am using here (g++-2.3.3)
seems to have a version of strtoul() in libg++.a that suffers from the
same problem as the strtoul() on AIX.

I made my ultrix installation of Tcl use the version of strtoul
provided on the compat subdirectory of the Tcl distribution an now
everything works fine.

Mario.



Thu, 28 Dec 1995 06:56:51 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. problems running fortran-based MCNP code on Decstation running Ultrix 4.2

2. Dynamic loading on Decstation running Ultrix (mips 4.4)

3. MUprolog installation on MIPS (DECstation 5000) running Ultrix

4. M2 Compilers for DECStation (RISC) and Ultrix wanted

5. Ayacc on a decstation (ultrix)

6. CL with CLX on DECstation (ULTRIX)

7. (a)kcl on DECstation-3100, Ultrix 3.1

8. Need Help: Decstation, Ultrix

9. Problem running tcl/tk application while other XWindows apps running

10. Is there Modura-2 running on DecStation ?

11. My Tcl/Tk based app core dumps.

12. Prolog for New Ultrix-Based VAX 3100

 

 
Powered by phpBB® Forum Software