3.2. Directly loading libpgtcl

This is normally done with the Tcl load command. Here is an example:

load libpgtcl[info sharedlibextension]

The use of info sharedlibextension is recommended in preference to using a platform-dependent extension such as .so, .sl, or .dll.

The load command will fail unless the system's dynamic loader knows where to look for the libpgtcl shared library file. You may need to work with ldconfig, or set the environment variable LD_LIBRARY_PATH, or use some equivalent facility for your platform to make it work. Of course, you can also specify a full path to the library in the load command.

libpgtcl in turn depends on libpq, so the dynamic loader must also be able to find the libpq shared library. Since you cannot directly specify the location of libpq, the system must be able to locate it using its default methods for finding loadable libraries. See Section 3.1, “Using the Tcl Package Command” for more information on locating the dependent library or libraries. To summarize, Linux systems use 'rpath' (hard-coded path to libpq at build time), and fall back to the loader configuration (ld.so.conf) or LD_LIBRARY_PATH; Windows (BCC build) requires blibpq.dll be in the PATH; and Windows (MinGW build) requires multiple libraries from the EnterpriseDB 'bin' directory be in the PATH.

SourceForge.net Logo

This version of the manual was produced for the Pgtcl-ng Sourceforge project web service site, which requires the logo on each page.

To download a logo-free copy of the manual, see the Pgtcl-ng project downloads area.