The following examples illustrate various uses of the LINK command line.
Example 1
LINK FUN+TEXT+TABLE+CARE, , FUNLIST, FUNPROG.LIB;
This command line links the object files FUN.OBJ, TEXT.OBJ, TABLE.OBJ, and CARE.OBJ. By default, the executable file is named FUN.EXE because the base name of the first object file is FUN and no name is specified for the executable file. The map file is named FUNLIST.MAP. LINK searches for unresolved external references in the library FUNPROG.LIB before searching in the default libraries. LINK does not prompt for a .DEF file because a semicolon appears before the deffile field.
Example 2
LINK FUN, , ;
This command produces a map file named FUN.MAP because a comma appears as a placeholder for the mapfile field on the command line.
Example 3
LINK FUN, ;
LINK FUN;
Neither of these commands produces a map file because commas do not appear as placeholders for the mapfile field. The semicolon (;) ends the command line and accepts all remaining defaults without prompting; the prompting default for the map file is not to create one.
Example 4
LINK MAIN+GETDATA+PRINTIT, , GETPRINT.LST;
This command links the files MAIN.OBJ, GETDATA.OBJ, and PRINTIT.OBJ. No module-definition file is specified, so LINK creates a DOS file if the real-mode default combined libraries are provided or a segmented executable file if the protect-mode libraries are provided. The map file GETPRINT.LST is created.
Example 5
LINK GETDATA+PRINTIT, , , , GETPRINT.DEF
This command links GETDATA.OBJ and PRINTIT.OBJ, using the information in GETPRINT.DEF. LINK creates a map file named GETDATA.MAP.