3.2.Directly loading `libpgtcl`
Prev | Chapter3.Loading pgtcl into an Application | Next

## 3.2.Directly loading `libpgtcl`

これはTcl load 命令により遂行される｡これが例である: This is normally done with the Tcl `load` command. Here is an example:

    load libpgtcl[info sharedlibextension]

so, .sl, or .dll の様なOS依存拡張よりも､ info sharedlibextension の使用の優先が推奨される｡ The use of `info sharedlibextension` is recommended in preference to using a platform-dependent extension such as `.so`, `.sl`, or `.dll`.

何処から､libpgtcl 外部函数を捜すべきかを､ 系の動的積込み譜が知らない限り､積込み命令は失敗する｡ それを働させるためには､ ldconfig を使うか､ 環境変数 LD_LIBRARY_PATH を設定するか､ 系特有の同等の設備を使うかする必要がある｡ 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 は順番にlibpqに依存するので､動的積込み譜もlibpq共有外部函数を 見付けられねばならない｡ libpqの位置を直接には指定できなので､ 積込可能な外部函数を見付ける既定の手段を使って､系が位置指定できなばならない｡ 依存する外部函数の位置の更なる情報は､ Section3.1, “Using the Tcl Package Command” を参照されたい｡Linux系はなにやらを要す(略); Windows (BCC 作成)は､ PATH内にblibpq.dll がある事を要求す; Windows (MinGW 作成) は､EnterpriseDB '二進数' ディレクトリーからの複数の外部函数が PATH内にある事を要す｡ `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 Section3.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`.

Prev | Up | Next
Chapter3.Loading pgtcl into an Application | Home | 3.3.Linking `libpgtcl` Into an Application