Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
<libraries> Field
◄Up► ◄Contents► ◄Index► ◄Back►
─────<libraries> Field──────────────────────────────────────────────────────
You can specify one or more standard or import libraries (not
DLLs) in the <libraries> field. LINK searches static libraries to
resolve external references. A static library is either a standard
library created by the LIB utility or an import library created by
the IMPLIB utility. In addition to specified libraries, LINK uses
the default libraries named in the object files.
See: ◄Default Libraries►
◄IMPLIB Summary►
◄LIB► (in LIB Help)
Syntax Rules
Separate multiple names with a plus (+) or space characters. To
extend <libraries> to the following line, use a plus sign (+) as
the last character on the current line. Do not split a name across
lines. The default extension is .LIB.
You can tell LINK to search additional directories for specified
or default libraries by specifying a drive or path in the
<libraries> field. End the name with a backslash (\).
The limit is 32 paths and libraries. LINK ignores additional paths
and libraries without displaying an error message.
If you do not specify libraries, LINK uses only the default
libraries. If libraries are specified, LINK uses them in the order
named before using the default libraries. If a default library is
explicitly specified, it is searched in the order designated. To
tell LINK to ignore the default libraries, use the /NOD option.
See: ◄/NOD Option►
How LINK Looks for Library Files
When searching for libraries, LINK looks in the following
locations in this order:
1. The directory specified for the file if a path is included.
If the file is not in that directory, the search terminates.
(The default libraries named in object files by Microsoft
compilers do not include path specifications.)
2. The current directory.
3. Any directories entered on the command line.
4. Any directories specified in the LIB environment variable.
See: ◄Library Search Example►
If LINK cannot locate a library file, it prompts you to enter the
location. The /BATCH option disables these prompts.
See: ◄/BATCH Option►
Using Libraries
Specify library names when you want to
■ Use a default library that has been renamed
■ Specify a library other than the default
■ Search additional libraries
■ Find a library not in the current directory and not in a
directory specified by the LIB environment variable
You can enter a library as a load library in the <objfiles> field.
Libraries specified in the <libraries> field and default libraries
add only those modules needed to resolve external references, not
the entire library. A load library adds all of its modules.
See: ◄Entering Library Files as Object Files►
◄<objfiles> Field►
-♦-