12.3 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 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 description file needed to create Windows and OS/2 applications and DLLs.

Fields are separated by commas. You can specify all the fields or leave one or more fields (including objfiles) blank; LINK will then prompt you for the missing input. (For an explanation of how to use LINK prompts, see Section 12.4, “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 Section 12.5, “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 pathname. Filenames are not case sensitive.

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