12.3.1 The objfiles Field

The objfiles field specifies one or more object files to be linked. At least one filename must be entered. If you do not supply an extension, LINK assumes a default .OBJ extension. If the filename has no extension, add a period (.) at the end of its name.

If you name more than one object file, separate the names with a plus sign (+) or a space. To extend objfiles to the following line, type a plus sign (+) as the last character on the current line, press ENTER, and continue. Do not split a name across lines.

12.3.1.1 Load Libraries

The objfiles field can also specify library files. A library specified this way
becomes a “load library.” You must specify the library's filename extension;
otherwise, LINK assumes an .OBJ extension.

LINK treats load libraries as any other object file: it puts every object module from a load library in the executable file, regardless of whether a module satisfies an unresolved external reference. The effect is the same as if you had specified all the library's object-module names in the objfiles field.

Specifying a load library can therefore create an executable file or DLL that is larger than it needs to be. (A library named in the libraries field adds only those modules required to resolve external references.) However, loading an entire library can be useful when

Repeatedly specifying the same group of object files

Placing a library in an overlay

Debugging, so you can call library routines that would not be included in the release version of the program

12.3.1.2 How LINK Searches for Object Files

When searching for object (and load-library) files, LINK looks in the following locations in the order specified:

1.The directory specified for the file (if a path is included). If the file is not in that directory, the search terminates.

2.The current directory.

3.Any directories specified in the LIB environment variable.

If LINK cannot find an object file, and a floppy drive is associated with that object file, LINK pauses and prompts you to insert a disk containing the object file.

If you specify a library in the objfiles field, LINK treats it like any other object file. LINK therefore does not search for load libraries in directories named in the libraries field.

12.3.1.3 Overlays

A special syntax for the objfiles field lets you create DOS programs that use overlay modules. For more information about overlays, see Section 12.7, “Using Overlays under DOS.”