The general syntax for invoking the linker is:
cl6x --run_linker [options] filename1 .... filenamen |
cl6x --run_linker | is the command that invokes the linker. The --run_linker option's short form is -z. |
options | can appear anywhere on the command line or in a linker command file. (Options are discussed in Section 8.4.) |
filename1, filenamen | can be object files, linker command files, or archive libraries. The default extension for all input files is .obj; any other extension must be explicitly specified. The linker can determine whether the input file is an object or ASCII file that contains linker commands. The default output filename is a.out, unless you use the --output_file option to name the output file. |
There are two methods for invoking the linker:
cl6x --run_linker file1.obj file2.obj --output_file=link.out
--output_file=link.out file1.obj file2.obj
Now you can invoke the linker from the command line; specify the command filename as an input file:
cl6x --run_linker linker.cmd
When you use a command file, you can also specify other options and files on the command line. For example, you could enter:
cl6x --run_linker --map_file=link.map linker.cmd file3.obj
The linker reads and processes a command file as soon as it encounters the filename on the command line, so it links the files in this order: file1.obj, file2.obj, and file3.obj. This example creates an output file called link.out and a map file called link.map.
For information on invoking the linker for C/C++ files, see Section 8.10.