[Xotcl] Tcl stubs

BRIAN THEADO brian.theado@usa.net
11 Jul 2001 09:34:11 EDT


Gustaf Neumann <neumann@wu-wien.ac.at> wrote:
>the only difficulties i see is 
>for older tcl-version not supporting the stub library.

I encountered some issues with undefined references while trying 
to build libxotcl.so using stubs on Linux.

Here's what I did:
Added the following lines to the top of function Xotcl_Init
in the file xotcl.c:
 #ifdef USE_TCL_STUBS
    if (Tcl_InitStubs(in, "8.1", 0) == NULL) {
        return TCL_ERROR;
    }
 #endif

Compiled with the additional flag -DUSE_TCL_STUBS

Linked libxotcl.so against libtclstub.a


Here are the undefined references I encountered:
One set of undefined references was due using the macro version
of TclNewObj instead of the function version (Tcl_NewObj) in 
xotclInt.h.  This can be fixed with an extra #ifdef USE_TCL_STUBS

The other undefined references stem from the use of the following
functions:
    Tcl_FormatObjCmd
    Tcl_IncrObjCmd
    Tcl_InfoObjCmd
    Tcl_RenameObjCmd
    Tcl_UplevelObjCmd
    Tcl_UpvarObjCmd
    Tcl_VariableObjCmd

I'm assuming these can be fixed by using Tcl_EvalObjv to access
the Tcl commands instead of calling them directly.  I haven't
tried it yet, but it seems reasonable to me.

____________________________________________________________________
Get free email and a permanent address at http://www.amexmail.com/?A=1