next up previous index
Next: Static Linking Up: Dynamic Linking Previous: Using .o Files

Using Shared Libraries

On machines that use shared libraries ( .so files) for dynamic loading, we must create one common shared object that contains all necessary extensions files and all Tcl and Tk files. The macro USER_OBJECTS   in the ProTcXl Makefile in the directory lib_graphic/$ARCH   should be set to all files, libraries and other parameters necessary for the extensions. Then, type make tkext.so to make a shared object with Tcl/Tk and all extensions.

On sparc_sunos5 we define for the Tree extension
USER_OBJECTS = /opt/unsupported/src/tcl/tree-4.0.1/tkAppInit.o \
    /opt/unsupported/src/tcl/tree-4.0.1/src/libTkTree.a \
    -L/opt/packages/gnu/lib -lg++ \
    -L/opt/packages/gnu/lib/gcc-lib/sparc-sun-solaris2.3/2.5.7 -lgcc
because we need both -lg++ and -lgcc libraries with their pathnames.

When the enhanced shared object is created, we can load the library

:- lib('tk/tkext').
and finally load all extensions with
:- tk_load('tkext.so')


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