load issue with extension in a tclkit

73 views
Skip to first unread message

Zbigniew Diaczyszyn

unread,
Aug 30, 2013, 4:12:49 AM8/30/13
to sta...@googlegroups.com
I tried to create an extension with the following parameters:

gcc -Wall -shared -fPIC -I ~/Programme/Active-Tcl-8.5/include/ -L ~/Programme/Active-Tcl-8.5/lib/ -ltclstub8.5 -o twofish.so twofish2tcl.c -DUSE_TCL_STUBS

The extension is initialized with the stubs option:

int Twofish_Init(Tcl_Interp *interp) {



if (Tcl_InitStubs(interp, "8.5", 0) == NULL) {

return TCL_ERROR;

}
...

Called with a tclsh interpreter it works well though ldd shows an unresolved symbol:

$ ldd -u twofish.so
4663: ./twofish.so: error: symbol lookup error: undefined symbol: tclStubsPtr (continued)
undefined symbol: tclStubsPtr (./twofish.so)

The created kit executable (AS basekit 8.5.13) shows finally the following error:

couldn't load file "/tmp/tclJ8M144": /tmp/tclJ8M144: undefined symbol: Tcl_InitStubs

In the net I couldn't find any details how a kit is loading extensions.



Schelte Bron

unread,
Aug 30, 2013, 6:00:49 AM8/30/13
to sta...@googlegroups.com
On 08/30/2013 10:12 AM, Zbigniew Diaczyszyn wrote:
> I tried to create an extension with the following parameters:
>
> gcc -Wall -shared -fPIC -I ~/Programme/Active-Tcl-8.5/include/ -L ~/Programme/Active-Tcl-8.5/lib/ -ltclstub8.5 -o twofish.so twofish2tcl.c -DUSE_TCL_STUBS
>
The order of the gcc arguments is important. Try:

gcc -Wall -shared -fPIC -DUSE_TCL_STUBS -I
~/Programme/Active-Tcl-8.5/include/ -o twofish.so twofish2tcl.c -L
~/Programme/Active-Tcl-8.5/lib/ -ltclstub8.5


Schelte.

Reply all
Reply to author
Forward
0 new messages