Training
Learning path
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The following properties are found under Project > Properties > Configuration Properties > Linker. For more information about the linker, see CL Invokes the Linker and Linker Options.
The /OUT
option overrides the default name and location of the program that the linker creates.
Prints Linker Progress Messages
Choices
The /VERSION
option tells the linker to put a version number in the header of the .exe
or .dll
file. Use DUMPBIN /HEADERS
to see the image version field of the OPTIONAL HEADER VALUES
to see the effect of /VERSION
.
Enables incremental linking. (/INCREMENTAL, /INCREMENTAL:NO
)
The /NOLOGO
option prevents display of the copyright message and version number.
This property tells the linker not to link any .lib
output generated from this build into any dependent project. It allows the project system to handle .dll
files that don't produce a .lib
file when built. If a project depends on another project that produces a DLL, the project system automatically links the .lib
file produced by that child project. This property may be unnecessary in projects that produce COM DLLs or resource-only DLLs, because these DLLs don't have any meaningful exports. If a DLL has no exports, the linker doesn't generate a .lib
file. If no export .lib
file is present, and the project system tells the linker to link with the missing DLL, the link fails. Use the Ignore Import Library property to resolve this problem. When set to Yes, the project system ignores the presence or absence of the .lib
file, and causes any project that depends on this project to not link with the nonexistent .lib
file.
To programmatically access this property, see IgnoreImportLibrary.
Runs regsvr32.exe /s $(TargetPath)
on the build output, which is valid only on .dll
projects. For .exe
projects, this property is ignored. To register an .exe
output, set a postbuild event on the configuration to do the custom registration that is always required for registered .exe
files.
To programmatically access this property, see RegisterOutput.
Registration in Visual Studio has traditionally been done in HKEY_CLASSES_ROOT
(HKCR). With Windows Vista and later operating systems, to access HKCR you must run Visual Studio in elevated mode. Developers don't always want to run in elevated mode but still must work with registration. Per-user redirection allows you to register without having to run in elevated mode.
Per-user redirection forces any writes to HKCR to be redirected to HKEY_CURRENT_USER
(HKCU). If per-user redirection is turned off, it can cause Project Build Error PRJ0050 when the program tries to write to HKCR.
Allows the user to override the environment's library path. (/LIBPATH:folder
)
Specifies whether to link the .lib
files that are produced by dependent projects. Typically, you want to link in the .lib
files, but it may not be the case for certain DLLs.
You can also specify a .obj
file by providing the file name and relative path, for example, ..\..\MyLibProject\MyObjFile.obj
. If the source code for the .obj
file has a #include
for a precompiled header, for example, pch.h
, then the pch.obj
file is located in the same folder as MyObjFile.obj
. You must also add pch.obj
as an additional dependency.
Specifies whether to use the inputs to the librarian tool, rather than the library file itself, when linking in library outputs of project dependencies. In a large project, when a dependent project produces a .lib
file, incremental linking is disabled. If there are many dependent projects that produce .lib
files, building the application can take a long time. When this property is set to Yes, the project system links in the .obj
files for .lib
files produced by dependent projects, enabling incremental linking.
For information about how to access the General linker property page, see Set compiler and build properties.
Specifies whether the linker should display a progress indicator showing what percentage of the link is complete. The default is to not display this status information. (/LTCG:STATUS|LTCG:NOSTATUS
)
/ALLOWBIND:NO
sets a bit in a DLL's header that indicates to Bind.exe
that binding the image isn't allowed. You may not want a DLL to be bound if it has been digitally signed (binding invalidates the signature).
/WX
causes no output file to be generated if the linker generates a warning.
The /FORCE
option tells the linker to create an .exe
file or DLL even if a symbol is referenced but not defined (UNRESOLVED
), or is defined multiple times (MULTIPLE
). It may create an invalid .exe
file.
Choices
/FORCE
with no arguments implies both /FORCE:MULTIPLE
and /FORCE:UNRESOLVED
./FORCE:MULTIPLE
to create an output file, even if LINK finds more than one definition for a symbol./FORCE:UNRESOLVED
to create an output file whether or not LINK finds an undefined symbol. /FORCE:UNRESOLVED
is ignored if the entry point symbol is unresolved.Prepares an image for hot patching.
Choices
The /SECTION
option changes the attributes of a section, overriding the attributes set when the .obj
file for the section was compiled.
Specifies extra dependency items to add to the link command line, for example kernel32.lib
.
The /NODEFAULTLIB
option tells the linker to remove one or more default libraries from the list of libraries it searches when resolving external references.
Specifies one or more names of default libraries to ignore. Separate multiple libraries with semi-colons. (/NODEFAULTLIB:[name, name, ...]
)
The /DEF
option passes a module-definition file (.def
) to the linker. Only one .def
file can be specified to LINK.
The /ASSEMBLYMODULE
option allows you to add a module reference to an assembly. Type information in the module won't be available to the assembly program that added the module reference. However, type information in the module will be available to any program that references the assembly.
/ASSEMBLYRESOURCE
embeds a resource file in the output file.
The /INCLUDE
option tells the linker to add a specified symbol to the symbol table.
The /DELAYLOAD
option causes delayed loading of DLLs. The dll name specifies a DLL to delay load.
The /ASSEMBLYLINKRESOURCE
option creates a link to a .NET Framework resource in the output file. The linker doesn't place the resource file in the output file.
/MANIFEST
specifies that the linker should create a side-by-side manifest file.
/MANIFESTFILE
lets you change the default name of the manifest file. The default name of the manifest file is the file name with .manifest
appended.
/MANIFESTDEPENDENCY
lets you specify attributes that will be placed in the dependency section of the manifest file.
Specifies behavior for manifest lookup. (/ALLOWISOLATION:NO
)
Specifies whether or not User Account Control is enabled. (/MANIFESTUAC, /MANIFESTUAC:NO
)
Specifies the requested execution level for the application when running with User Account Control. (/MANIFESTUAC:level=[value]
)
Choices
Specifies whether or not to bypass user interface protection levels for other windows on the desktop. Set this property to 'Yes' only for accessibility applications. (/MANIFESTUAC:uiAccess=[true | false]
)
This option enables creation of debugging information for the .exe
file or the DLL.
Choices
By default, when /DEBUG
is specified, the linker creates a program database (PDB) which holds debugging information. The default file name for the PDB has the base name of the program and the extension .pdb
.
The /PDBSTRIPPED
option creates a second program database (PDB) file when you build your program image with any of the compiler or linker options that generate a PDB file (/DEBUG
, /Z7
, /Zd
, or /Zi
).
The /MAP
option tells the linker to create a mapfile.
A user-specified name for the mapfile. It replaces the default name.
The /MAPINFO
option tells the linker to include the specified information in a mapfile, which is created if you specify the /MAP
option. EXPORTS
tells the linker to include exported functions.
/ASSEMBLYDEBUG
emits the DebuggableAttribute
attribute with debug information tracking and disables JIT optimizations.
The /SUBSYSTEM
option tells the operating system how to run the .exe
file. The choice of subsystem affects the entry point symbol (or entry point function) that the linker will choose.
Choices
main
or wmain
is defined, CONSOLE
is the default.WinMain
or wWinMain
is defined, WINDOWS
is the default./DRIVER:WDM
is specified, NATIVE
is the default.Specify the minimum required version of the subsystem. The arguments are decimal numbers in the range 0 through 65535.
Specifies total heap allocation size in virtual memory. Default is 1 MB. (/HEAP:reserve
)
Specifies total heap allocation size in physical memory. Default is 4 KB. ([/HEAP:reserve,commit
](heap-set-heap-size.md))
Specifies the total stack allocation size in virtual memory. Default is 1 MB. (/STACK:reserve
)
Specifies the total stack allocation size in physical memory. Default is 4 KB. (/STACK:reserve,commit
)
The /LARGEADDRESSAWARE
option tells the linker that the application can handle addresses larger than 2 gigabytes. By default, /LARGEADDRESSAWARE:NO
is enabled if /LARGEADDRESSAWARE
isn't otherwise specified on the linker line.
The /TSAWARE
option sets a flag in the IMAGE_OPTIONAL_HEADER
DllCharacteristics
field in the program image's optional header. When this flag is set, Terminal Server won't make certain changes to the application.
The /SWAPRUN
option tells the operating system to first copy the linker output to a swap file, and then run the image from there. This option is a Windows NT 4.0 (and later) feature. When CD
is specified, the operating system will copy the image on a removable disk to a page file, and then load it.
The /SWAPRUN
option tells the operating system to first copy the linker output to a swap file, and then run the image from there. This option is a Windows NT 4.0 (and later) feature. If NET
is specified, the operating system will first copy the binary image from the network to a swap file and load it from there. This option is useful for running applications over the network.
Use the /DRIVER
linker option to build a Windows NT kernel mode driver.
Choices
/DRIVER:UPONLY
causes the linker to add the IMAGE_FILE_UP_SYSTEM_ONLY
bit to the characteristics in the output header to specify that it's a uniprocessor (UP) driver. The operating system will refuse to load a UP driver on a multiprocessor (MP) system./DRIVER:WDM
causes the linker to set the IMAGE_DLLCHARACTERISTICS_WDM_DRIVER
bit in the optional header's DllCharacteristics
field./OPT:REF
eliminates functions and/or data that's never referenced while /OPT:NOREF
keeps functions and/or data that's never referenced.
Use /OPT:ICF[=iterations]
to perform identical COMDAT folding.
The /ORDER
option tells LINK to optimize your program by placing certain COMDATs into the image in a predetermined order. LINK places the functions in the specified order within each section in the image.
Specify the .pgd
file for profile guided optimizations. (/PGD
)
Specifies link-time code generation. (/LTCG
)
Choices
/FASTGENPROFILE
.:PGINSTRUMENT
.:PGINSTRUMENT
phase.Specify MIDL command line options. (/MIDL:@responsefile
)
The /IGNOREIDL
option specifies that any IDL attributes in source code shouldn't be processed into an .idl
file.
The /IDLOUT
option specifies the name and extension of the .idl
file.
The /TLBOUT
option specifies the name and extension of the .tlb
file.
Allows you to specify the resource ID of the linker-generated type library. (/TLBID:id
)
Enables or disables generation of Windows Metadata.
Choices
The /WINMDFILE
option switch.
Specify a key or key pair to sign the Windows Metadata. (/WINMDKEYFILE:filename
)
Specify a key container to sign the Windows Metadata. (/WINMDKEYCONTAINER:name
)
Partially sign the Windows Metadata. Use /WINMDDELAYSIGN
if you only want to place the public key in the Windows Metadata. The default is /WINMDDELAYSIGN:NO
.
The [/ENTRY
](entry-entry-point-symbol.md) option specifies an entry point function as the starting address for an .exe
file or DLL.
The /NOENTRY
option is required for creating a resource-only DLL. Use this option to prevent LINK from linking a reference to _main
into the DLL.
The /RELEASE
option sets the Checksum in the header of an .exe
file.
Sets a base address for the program. (/BASE:{address[,size] | @filename,key}
)
Randomized Base Address. (/DYNAMICBASE[:NO]
)
Creates a program that can be loaded only at its preferred base address. (/FIXED[:NO]
)
Marks an executable as having been tested to be compatible with Windows Data Execution Prevention feature. (/NXCOMPAT[:NO]
)
The /NOASSEMBLY
option tells the linker to create an image for the current output file without a .NET Framework assembly.
The UNLOAD
qualifier tells the delay-load helper function to support explicit unloading of the DLL. (/DELAY:UNLOAD
)
The NOBIND
qualifier tells the linker not to include a bindable Import Address Table (IAT) in the final image. The default is to create the bindable IAT for delay-loaded DLLs. (/DELAY:NOBIND
)
Overrides the default import library name. (/IMPLIB:filename
)
The /MERGE
option combines the first section with the second section, and gives the resulting section the second section name. For example, /merge:.rdata=.text
merges the .rdata
section with the .text
section, and names the combined section .text
.
The /MACHINE
option specifies the target platform for the program.
Choices
Produces an output file that can be used with the Performance Tools profiler. Requires the Generate Debug Info property be set to GenerateDebugInformation (/DEBUG). (/PROFILE
)
Explicitly specify the threading attribute for the entry point of your CLR program.
Choices
/CLRTHREADATTRIBUTE
. Lets the Common Language Runtime (CLR) set the default threading attribute.Sets the type (IJW, pure, or safe) of a CLR image.
Choices
Specify key or key pair to sign an assembly. (/KEYFILE:filename
)
Specify a key container to sign an assembly. (/KEYCONTAINER:name
)
Partially sign an assembly. Use /DELAYSIGN
if you only want to place the public key in the assembly. The default is /DELAYSIGN:NO
.
/CLRUNMANAGEDCODECHECK
specifies whether the linker will apply SuppressUnmanagedCodeSecurityAttribute
to linker-generated P/Invoke calls from managed code into native DLLs.
Allows you to provide internal compiler error (ICE) information directly to the Visual Studio C++ team.
Choices
The /ALIGN
option specifies the alignment of each section within the linear address space of the program. The number argument is in bytes and must be a power of two.
/CLRSUPPORTLASTERROR
, which is on by default, preserves the last error code of functions called through the P/Invoke mechanism, which allows you to call native functions in DLLS, from code compiled with /clr
.
Choices
/CLRSupportLastError
./CLRSupportLastError
./CLRSupportLastError
for system DLLs only.When /SAFESEH
is specified, the linker will only produce an image if it can also produce a table of the image's safe exception handlers. This table specifies for the operating system which exception handlers are valid for the image.
Training
Learning path
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization