next up previous index
Next: ProTcXl with Parallel Up: Separate Loading Previous: Using .o Files

Using Shared Libraries

On some architectures it is currently not possible to load separate extensions, because dynamically loaded shared objects cannot reference previously loaded shared objects, and this is alwasy the case with Tcl/Tk extensions. On architectures that support this loading, perform the following steps:

.

A stand-alone initialisation file for the Tree extension would be

:- lib(tk).

:- load('tree.so').

:-
    (tcl_interp(I) ->
        true
    ;
        tk([]),                % not yet started
        tcl_interp(I)
    ),
    call_c('Tree_Init'(I), _),
    call_c('Dir_Init'(I), _).
As we can see, it is quite similar to the file that uses .o format for dynamic loading and it is thus not very difficult to write system-independent application initialisation files.



next up previous index
Next: ProTcXl with Parallel Up: Separate Loading Previous: Using .o Files



Micha Meier
Tue Jul 2 09:49:39 MET DST 1996