Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 1.67 KB

compiler-controlled-link-options.md

File metadata and controls

36 lines (31 loc) · 1.67 KB
descriptiontitlems.datehelpviewer_keywordsms.assetid
Learn more about: Compiler-Controlled LINK Options
Compiler-Controlled LINK Options
11/04/2016
LINK tool [C++], compiler-controlled options
linker [C++], CL compiler control
linking [C++], affected by CL features
cl.exe compiler [C++], features that affect linking
cl.exe compiler [C++], controlling linker
e4c03896-c99c-4599-8502-e0f4bebe69d0

Compiler-Controlled LINK Options

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.

CL specificationCL action that affects LINK
Any file name extension other than .c, .cxx, .cpp, or .defPasses a file name as input to LINK
filename.defPasses /DEF:filename.def
/FnumberPasses /STACK:number
/FdfilenamePasses /PDB:filename
/FefilenamePasses /OUT:filename
/FmfilenamePasses /MAP:filename
/GyCreates packaged functions (COMDATs); enables function-level linking
/LDPasses /DLL
/LDdPasses /DLL
/linkPasses remainder of command line to LINK
/MD or /MTPlaces a default library name in the .obj file
/MDd or /MTdPlaces a default library name in the .obj file. Defines the symbol _DEBUG
/nologoPasses /NOLOGO
/ZdPasses /DEBUG
/Zi or /Z7Passes /DEBUG
/ZlOmits default library name from .obj file

For more information, see MSVC Compiler Options.

See also

MSVC linker reference
MSVC Linker Options

close