Loading pgtcl into an Application

Before using pgtcl commands, you must load libpgtcl into your application. You would normally do this with the Tcl load command. Here is an example:

   load libpgtcl[info sharedlibextension]

The use of info sharedlibextension is preferable to hard-coding .so or .sl into the program.

The load command will fail unless the system's dynamic loader knows where to look for the libpgtcl shared library. You may need to work with ldconfig or to set the environment variable LD_LIBRARY_PATH.

libpgtcl in turn depends on libpq, so the dynamic loaded must also be able to find the libpq shared library. In practice this is seldom an issue as both of these shared libraries are normally stored in the same directory, but it can be a problem in some configurations. The default location of these libraries in the standard Red Hat Database installation is /usr/lib.