更新时间:2023-09-17 11:20:10
为什么忽略默认的LIBC库?
使用/ MT
选项时, libcmt。需要lib (resp。 libcmtd.lib 用于调试版本)。这些库包含启动使用的标准C库函数(可能还有全局__ argc
和__ argv
变量)代码位于MSVCRT库中。
也没有必要将MSVCRT和其他标准Windows库指定为附加依赖项,因为它们在使用这些库中的函数时会自动链接(MSVCRT始终如此)。
Why do you ignore the default LIBC libraries?
When using the/MT
option, libcmt.lib is required (resp. libcmtd.lib for debug builds). Those libraries contain the standard C library functions (and probably the global__argc
and__argv
variables) which are used by the startup code located in the MSVCRT library.
There is also no need to specify MSVCRT and other standard Windows libraries as additional dependancies because they are automatically linked when using functions from those libraries (which is always true for the MSVCRT).