### LIBPATH Environment Variable (OS/2)

The OS/2 operating system searches the directories specified by this environment variable to find all DLL files required by a program. LIBPATH is set at system startup and cannot be reset dynamically. The library DLLs and any user DLLs must be in one of the directories specified by LIBPATH.

Set this variable in your config.sys file. For example, the following statement says to look for DLLs first in the current directory, then in directory C:\cmlib, and finally in the main DLL directory:

>     LIBPATH=.;C:\cmlib;C:\IBMCXXO\DLL

The IBM C and C++ Compilers installation process puts all DLLs supplied with the product into directory IBMCXXO\DLLby default. If you select the option to update config.sys during installation, the LIBPATH statement in config.sys is modified to include this directory.

Unlike the PATH environment variable, you must explicitly list a "." (period) in the LIBPATH statement, if you want the current directory to be searched first .

LIBPATH can be useful in switching between conflicting versions of a tool. Simply create an empty DLL directory somewhere in the LIBPATH and copy the required DLLs into this directory to control version execution.

You cannot change LIBPATH with the set command. However, set beginlibpath and set endlibpath commands provide a mechanism for extending this environment variable dynamically, as described in system help for OS/2 Warp 4.

Applications can use OS/2 APIs DosSetExtLIBPATH to set the path extension and DosQueryExtLIBPATH to query the current extension. Parameters of these functions tell the system whether the extension should go before or after the current setting.

Application Run-Time Environment Variables

Set OS/2 Run-Time Environment Variables

DPATH Environment Variable
PATH Environment Variable