Edit

Share via


Link options

The CRT lib directory includes several small object files that enable specific CRT features without code changes. These object files are called "link options" because you only have to add them to the linker command line to use them. To do this from Visual Studio, in the Solution Explorer right-click your project and choose Properties. Under Configuration Properties, choose Linker > Input > Additional Dependencies and specify the additional items to add to the link command line.

CLR pure mode versions of these objects are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017. Use the regular versions for native and /clr code.

Native and /clrPure modeDescription
binmode.objpbinmode.objSets the default file-translation mode to binary. See _fmode.
chkstk.objn/aProvides stack-checking and alloca support when not using the CRT.
commode.objpcommode.objSets the global commit flag to "commit". See fopen, _wfopen and fopen_s, _wfopen_s.
exe_initialize_mta.libn/aInitializes the MTA apartment during EXE startup, which allows the use of COM objects in global smart pointers. Because this option leaks an MTA apartment reference during shutdown, don't use it for DLLs. Linking to this file is equivalent to including combase.h and defining _EXE_INITIALIZE_MTA. Using this link option adds onecore.lib to the default library list. If this effect is undesirable (such as using onecore_apiset.lib or other umbrella library), use /NODEFAULTLIB to override this behavior and provide an alternative.
fp10.objn/aChanges the default precision control to 64 bits. See Math and floating-point support.
invalidcontinue.objpinvalidcontinue.objSets a default invalid parameter handler that does nothing, meaning that invalid parameters passed to CRT functions will just set errno and return an error result.
legacy_stdio_float_rounding.objn/aThe printing of floating-point values (for example, when using printf) with the Windows 10 19041 Universal C Runtime has been fixed. It now properly rounds exactly representable floating-point numbers, and respects the floating-point rounding requested by fesetround. This behavior update is available in Visual Studio 2019 version 16.2 and later. Legacy behavior is used in earlier versions of Visual Studio, or by providing this link option.
loosefpmath.objn/aEnsures that floating point code tolerates denormal values.
newmode.objpnewmode.objCauses malloc to call the new handler on failure. See _set_new_mode, _set_new_handler, calloc, and realloc.
noarg.objpnoarg.objDisables all processing of argc and argv.
nochkclr.objn/aDoes nothing. Remove from your project.
noenv.objpnoenv.objDisables the creation of a cached environment for the CRT.
nothrownew.objpnothrownew.objEnables the non-throwing version of new in the CRT. See new and delete Operators.
setargv.objpsetargv.objEnables command-line argument wildcard expansion. See Expanding wildcard arguments.
threadlocale.objpthreadlocale.objEnables per-thread locale for all new threads by default.
wsetargv.objpwsetargv.objEnables command-line argument wildcard expansion. See Expanding wildcard arguments.

See also