แก้ไข

แชร์ผ่าน


Link options

The CRT lib directory includes several small object files that enable specific CRT features without any code change. These object files are called "link options" since you only have to add them to the linker command line to use them.

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 /clr Pure mode Description
binmode.obj pbinmode.obj Sets the default file-translation mode to binary. See _fmode.
chkstk.obj n/a Provides stack-checking and alloca support when not using the CRT.
commode.obj pcommode.obj Sets the global commit flag to "commit". See fopen, _wfopen and fopen_s, _wfopen_s.
exe_initialize_mta.lib n/a Initializes 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.obj n/a Changes the default precision control to 64 bits. See Math and floating-point support.
invalidcontinue.obj pinvalidcontinue.obj Sets 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.obj n/a The 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.obj n/a Ensures that floating point code tolerates denormal values.
newmode.obj pnewmode.obj Causes malloc to call the new handler on failure. See _set_new_mode, _set_new_handler, calloc, and realloc.
noarg.obj pnoarg.obj Disables all processing of argc and argv.
nochkclr.obj n/a Does nothing. Remove from your project.
noenv.obj pnoenv.obj Disables the creation of a cached environment for the CRT.
nothrownew.obj pnothrownew.obj Enables the non-throwing version of new in the CRT. See new and delete Operators.
setargv.obj psetargv.obj Enables command-line argument wildcard expansion. See Expanding wildcard arguments.
threadlocale.obj pthreadlocale.obj Enables per-thread locale for all new threads by default.
wsetargv.obj pwsetargv.obj Enables command-line argument wildcard expansion. See Expanding wildcard arguments.

See also