Go up one levelGo to Previous Go to Next

If you are using shared libraries

The Rtd shared library librtd.sl (in HPs) or librtd.so (on Suns) is built with the same options used to build the Tcl shared library. The options are read from the file tclConfig.sh, which is searched for in the following places:

This assumes that you have built and installed Tcl with the same "--enable-shared" and compiler option used for Rtd.

You may need to modify the SHLIB_PATH (HP) or LD_LIBRARY_PATH (Sun) environment variable so that the necessary shared libraries are found at run time. Both variables have the same format: a colon ":" separated list of directories to search for shared libraries.

From a tcl script you can load the RTD library dynamically with the command "load <path>/librtd.sl" or "load <path>/librtd.so" or it can be loaded automatically as a package. See the Tcl man pages for more information.

You can check with the program below if the shared library is loadable. If librtd.sl on HP-UX is not properly built you get the misleading error message "Not enough memory".

 
#include <dl.h>
 
#include <errno.h>
 
#include <stdio.h>
 
main(int argc, char *argv[])
 
{
 
  shl_t handle;
 
  handle = shl_load(argv[1], BIND_IMMEDIATE | BIND_VERBOSE, 0L);
 
  if (handle == 0)
 
    {
 
    printf("shl_load failed %s\n", argv[1]);
 
    perror("");
 
    }
 
  else
 
    printf("shl_load ok\n");
 
}


Go up one levelGo to Previous Go to Next

Please send questions or comments to abrighto@eso.org.
Copyright © 1998 ESO - European Southern Observatory