gpt4 book ai didi

c - Microsoft C 运行时中的 msvcp140_1.dll 和 msvcp140_2.dll 文件是什么?

转载 作者:行者123 更新时间:2023-12-05 01:12:25 28 4
gpt4 key购买 nike

我正在尝试将 C 库导入 Visual Studio 项目。该库附带以下文件:

msvcp140.dll
msvcp140_1.dll
msvcp140_2.dll

我知道这些是 Microsoft C 运行时 DLL 文件。但我想更多地了解这些文件的用途。我想知道我需要什么二进制文件以及包含它们会产生什么后果。

msvcp140_1.dllmsvcp140_2.dll 文件的用途是什么?

最佳答案

这些文件实际上是 C++ 标准库的实现(参见其名称中的 p)。来自 CRT Library Features | Microsoft Docs 上的 C++ 标准库 部分:

When you build a release version of your project, one of the basic C run-time libraries (libcmt.lib, msvcmrt.lib, msvcrt.lib) is linked by default, depending on the compiler option you choose (multithreaded, DLL, /clr). If you include one of the C++ Standard Library header files in your code, a C++ Standard Library will be linked in automatically by Visual C++ at compile time. For example:

#include <ios>

For binary compatibility, more than one DLL file may be specified by a single import library. Version updates may introduce dot libraries, separate DLLs that introduce new library functionality. For example, Visual Studio 2017 version 15.6 introduced msvcp140_1.dll to support additional standard library functionality without breaking the ABI supported by msvcp140.dll. The msvcprt.lib import library included in the toolset for Visual Studio 2017 version 15.6 supports both DLLs, and the vcredist for this version installs both DLLs. Once shipped, a dot library has a fixed ABI, and will never have a dependency on a later dot library.

由于 Microsoft 的 C++ 标准库是开源的,您可以轻松查看这些附加功能是什么,例如stl/CMakeLists.txt甚至描述文件:

# msvcp140_1.dll (the memory_resource satellite)

# msvcp140_2.dll (the special math satellite)

但是 the source filenames已经有自己的描述性了。

关于c - Microsoft C 运行时中的 msvcp140_1.dll 和 msvcp140_2.dll 文件是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62000672/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com