admin管理员组文章数量:1122832
Using Visual Studio 2022, and linking a C++ executable or DLL to the MSVCRT as dynamic library (DLL, using /MD switch), is there a function call to determine at runtime the exact MSVCRT version that is actually used by the current module (the version of the msvcrt DLLs actually used)?
- I know about the _MSC_VER, _MSC_VER_FULL and _MSC_BUILD defines that give me the "compiler" version at build time. I'm not asking for those. I'm looking for an quivalent at runtime.
- I want to double check programmatically that the MSVCRT runtime that is loaded is at least as new or newer than what the binary was build against and give a warning otherwise.
- I know that I can get the file version of the DLL (for example msvcp140.dll) when enumerating loaded modules, but that gets complicated and guesswork quickly when multiple versions of the runtime are loaded due to private versions in a DLL.
Background is a nasty change ("fix") to the STL in MS Visual Studio 2022 V 17.10 in regards to std::mutex constexpr constructor, which requires that the runtime version is at least 19.40, otherwise causing a nullptr being dereferenced at runtime when calling std::mutex::lock(). So I want to check the rule that the runtime should be at least as new as what the binaries were build with.
本文标签: windowsGetting bound Microsoft Visual C Runtime versionStack Overflow
版权声明:本文标题:windows - Getting bound Microsoft Visual C++ Runtime version - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736282169a1926557.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论