The CL compiler automatically calls LINK unless you specify the /c option. CL provides some control over the linker through command-line options and arguments. The following table summarizes the features in CL that affect linking.
Compiler-Controlled LINK Options
CL command-line specification |
CL action that affects LINK |
---|---|
Any file name extension other than .c, .cxx, .cpp, or .def | Passes a file name as input to LINK. |
filename.def | Passes /DEF:filename.def. |
/Fnumber | Passes /STACK:number. |
/Fdfilename | Passes /PDB:filename. |
/Fefilename | Passes /OUT:filename. |
/Fmfilename | Passes /MAP:filename. |
/Gy | Creates packaged functions (COMDATs); enables function-level linking. |
/LD | Passes /DLL. |
/LDd | Passes /DLL. |
/link | Passes remainder of command line to LINK. |
/MD, /ML, or /MT | Places a default library name in the .obj file. |
/MDd, /MLd, or /MTd | Places a default library name in the .obj file. Defines the symbol _DEBUG. |
/nologo | Passes /NOLOGO. |
/Zd | Passes /DEBUG /DEBUGTYPE:COFF. |
/Zi or /Z7 | Passes /DEBUG /DEBUGTYPE:CV. |
/Zl | Omits default library name from .obj file. |
For more information on compiler options, see Compiler Option Reference.
Setting Linker Options | Linker Options | FAQ: Building Your Program