14.4 LINK Syntax and Input

The LINK command has the following syntax:

LINK objfiles[[, [[exefile]] [[, [[mapfile]][[, [[libraries]][[, [[deffile]] ]] ]] ]] ]] [[;]]

The LINK fields perform the following functions:

The objfiles field is a list of the object files that are to be linked into an executable file or DLL. It is the only required field.

The exefile field lets you change the name of the output file from its default.

The mapfile field creates a map file or gives the map file a name other than its default name.

The libraries field specifies additional (or replacement) libraries to search for unresolved references.

The deffile field gives the name of a module-definition (.DEF) file.

Fields are separated by commas. You can specify all the fields, or you can leave one or more fields (including objfiles) blank; LINK then prompts you for the missing input. (For information on LINK prompts, see “Running LINK”.) To leave a field blank, enter only the field's trailing comma.

Options can be specified in any field. For descriptions of each of LINK's options, see “LINK Options”.

The fields must be entered in the order shown, whether they contain input or are left blank. A semicolon (;) at the end of the LINK command line terminates the command and suppresses prompting for any missing fields. LINK then assumes the default values for the missing fields.

If your file appears in or is to be created in another directory or device, you must supply the full path. Filenames are not case sensitive. If the filename contains a space (supported on some installable file systems), enclose the name in single or double quotation marks (' or ").

The next five sections explain how to use each of the LINK fields.