Skip to content
Tcl Source Code View Ticket
Login

View Ticket

8.1 installation issue? Tcl_Init no longer supported?

Closed / Fixed218128ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:53:28
OriginalBugID: 1987 Bug
Version: 8.1
SubmitDate: '1999-05-05'
LastModified: '1999-11-07'
Severity: CRIT
Status: Closed
Submitter: pat
ChangedBy: hobbs
OS: Solaris
OSVersion: 2.5
Machine: Other
FixedDate: '2000-10-25'
ClosedDate: '1999-11-07'


Name: Paul Danielson

Comments:
My 8.1 version of tclsh and wish both operate fine, but the C-API seems
    flakey.
    I tried directly evaluating the init.tcl script, which got me a little
    further and then into a core-dump. Any thoughts would be appreciated.

ReproducibleScript:
int
    main(argc, argv)
      int    argc;
      char **argv;
    {
      int  status;
    
      Tcl_Interp* interp;
      Tcl_Obj*    zero;
      Tcl_Obj*    name;
    
      status = TCL_OK;
    
      interp = Tcl_CreateInterp();
    
      zero = Tcl_NewBooleanObj( 0 );
      name = Tcl_NewStringObj( "::appDone", 9 );
      Tcl_ObjSetVar2( interp, name, NULL, zero, 0 );
    
      if( (status = Tcl_Init( interp )) != TCL_ERROR )
      {
        if( (status = Tk_Init( interp )) != TCL_ERROR )
        {
        }
      } else
    printf("interp = %s\n", interp->result);
    
    printf("status = %s\n", (status == TCL_ERROR) ? "error" : "good");
    
      return status;
    }
    
    compile with gcc:
    gcc -I/usr/openwin/include -I/home/tcl/include -I.  -c  test.c
    gcc -I/usr/openwin/include -I/home/tcl/include -I.  -L/home/tcl/lib
    -R/home/tcl/lib -ltcl8.1 -ltk8.1 -lstdc++ -L/usr/openwin/lib -lX11 -lm
    test.o  -o tester
    
    Then execute tester. This is on a Solaris 2.5/SPARC platform.

ObservedBehavior:
The result field of the intepreter contains:
    interp = Can't find a usable init.tcl in the following directories: 
        
    
    This probably means that Tcl wasn't installed properly.
    
    I installed it the same way as always: configure --enable-gcc
    --prefix=/home/tcl; make; make install. Tcl_Init does not seem to be a
    documented command (at least on the web site man pages), but it did work
    in 8.0, and the change log didn't say "DANGER!!! Incompatible!". Going
    back to 8.0 on the compile line (-ltcl8.0) restores the expected
    behaviour.

DesiredBehavior:
Initialization of the interpreter, and a functioning program...



Tcl_FindExecutable needs to be called first to set up the i18n
stuff and find the right directories.  Use of this can be seen
in the source.  Unfortunately, this wasn't documented appropriately. 
-- 11/07/1999 hobbs
welch Closed ticket [218128ffff]. [History diff]2000-10-26 08:15:55
dgp Ticket [218128ffff]: 3 changes [History diff]2001-04-05 08:22:19
Log in (anonymous is fine) to add a comment.