LINK Options

The official literature for LINK does document most command-line options. However, undocumented options do exist and some of the documented options are arguably not documented well—indeed, are documented misleadingly.

In the list below of LINK options recognised by version 7.00.9466, those that the January 2004 edition of the MSDN Library on CD does not document for LINK are highlighted yellow. Several more have at least some undocumented feature to their syntax or behaviour. A few of the highlighted options are semi-documented, e.g., by being listed in the output of the link /? command, or by being used in some batch file or makefile that Microsoft publishes either with Visual C++ or with some software development kit, or by being actually documented but for some other of Microsoft’s C/C++ products.

The alternative documentation attempted here assumes familiarity with the general syntax of linker options. For only very few options is more attempted than just the syntax. This documentation is at best a work in progress, and what progress there is may of course cease at any time, indefinitely, for lack of support.

The options listed below are all those that LINK recognises. Anything else causes warning LNK4044 if given on the command line. While LINK processes options from .drectve sections, only some of the options are valid. Others cause warning LNK4229.

Option Supported in .drectve sections
/? yes, if given as /??
else no, causing fatal error LNK1117
/align yes
/allowbind no
/assemblymodule yes
/assemblyresource no
/b2 no
/base yes
/brepro no
/comment yes
/d2 no
/debug no
/debugtype no
/def no
/defaultlib yes
/delay no
/delayload no
/disallowlib yes
/dll yes
/dllchar no
/driver no
/editandcontinue yes
/encpadsize yes
/entry yes
/exetype yes
/expectedoutputsize no
/export yes
/fe yes
/filealign no
/fixed no
/force no
/fullbuild yes
/hdrsize no
/heap yes
/idlout no
/ignore no
/ignoreidl no
/implib no
/include yes
/incremental yes
/largeaddressaware no
/last no
/libpath no
/linkrepro no
/ltcg no
/machine no
/map no
/mapinfo no
/merge yes
/midl no
/name yes
/noassembly no
/nod and /nodefaultlib yes
/noentry no
/nologo no
/nooptidata no
/opt no
/order no
/osversion no
/out yes
/pchmap no
/pdb no
/pdbaltpath no
/pdbcompress no
/pdbpath no
/pdbstripped no
/pdbtype no
/pgd no
/pgi no
/pgo no
/profile no
/re yes
/release no
/section yes
/sourcemap no
/stack yes
/stub no
/subsystem yes
/swaprun no
/test no
/time no
/tlbid no
/tlbout no
/tmp no
/tsaware no
/verbose no
/version yes
/vxd yes
/windowsce no
/ws no
/wx no
/xoff no