LINK.EXE Command-Line Syntax

Whether the linker runs as DUMPBIN, EDITBIN, LIB or LINK, its operation is controlled in the first instance by directives given as text, typically but not only on the command line. Directives are separated by white space, subject to enclosure of white space by double-quotes. Three general categories are recognised:

Options begin with a hyphen or forward slash. A command-file directive is an @ followed immediately by the name of a command file, whose text provides more directives. Any other directive names an input file, or files if the name contains wildcards.

The linker gets these directives at first from what is in effect an extended command line drawn from several sources, in the following order:

It is common, though not strictly correct, to talk of all the directives as command-line options, parameters, arguments, etc, even if the linker may in fact have picked them up from an environment variable or command file. It is the standard practice of these notes that references to the command line, unless qualified as the actual command line, mean an effective command line composed as above.

Note that the LINK and _LINK_ environment variables contribute to the command line only for LINK, not for DUMPBIN, EDITBIN or LIB. Note also that command-file directives are recognised only on the actual command line, not in environment variables and not recursively in command files. A command-file directive in these other sources is interpreted as an input-file directive, with the @ beginning the name of the input file.

Depending on what the linker is asked to do in directives given on the command line, it may later pick up more directives from object files. Only options are valid. Command-file and input-file directives cause fatal error 1276. Otherwise, the rules are much the same as for directives given on the command line.