#LINK metastatement  


LINK a pre-compiled Static Link Library (SLL) or a Power Library (PBLIB) into your host program.


#LINK "filespec.SLL"

#LINK "filespec.PBLIB"


The #LINK metastatement is used to link pre-compiled Unit files (SLL or PBLIB) into your primary host program.  The host program must compile to an EXE or DLL module.  You cannot link a unit file into another unit file.

If a specified SLL unit file (or a component SLL in a PBLIB) is not needed by other compiled code, it is ignored entirely.  This allows the host program to be compiled to the smallest possible size.

The filespec may include an optional path name, and must include the extension ".SLL" or ".PBLIB".  The #LINK metastatement may be placed at any location in your source file, as long as it is outside of any block structure, such as Sub, Function, Method, Class, etc.

#LINK shares the file search path with #INCLUDE.  If filespec does not include a path, the compiler scans the search path for each #LINK file before checking the current (default) directory.  For the IDE, the search path can be set in the Compiler Preferences tab in the Options dialog.  The search path can also be specified when compiling from the command-line by using the /I Include option.  The search path can contain one path or multiple paths to scan.  If multiple paths are used, they are separated by a semicolon (;).

See Also