c++ - 使用 Visual Studio 2012 并使用旧平台工具集进行编译?

标签 c++ visual-studio dll visual-studio-2012 visual-c++-runtime

问题

我正在使用 Visual Studio 2012 开发 C++ DLL。在某些机器上,这些 DLL 无法加载,因为缺少设置为“v110”的平台工具集。

我尝试安装较旧的 c++ 运行时。他们没有安装,因为“已经安装了较新的版本”。我还安装了当前的 Windows SDK,但除了 v110 之外,仍然没有其他项目可供选择。

问题

如何使用旧版本的 C++ 运行时编译我的 C++ DLL,以便它可以在非开发人员机器上运行?

Platform toolset is v110

最佳答案

根据this page on MSDN ,您需要拥有相应版本的 Visual Studio(2008 或 2010),或“平台工具集”下拉列表中的相关 Windows SDK 以列出这些版本:

To change the target platform toolset, you must have the associated version of Visual Studio or the Windows Platform SDK installed.

您似乎也对控制哪个编译器/链接器/等的“平台工具集”感到有些困惑。用于构建您的应用程序,以及“Visual C++ Redistributable”,这是运行您的应用程序所必需的。您不能在用户的 PC 上安装“平台工具集”,也不能通过在开发 PC 上安装特定的“Visual C++ Redistributable”来提供该工具集。

此外,据我所知,Visual C++ Redistributable 不包括 MFC 运行时。它们可作为单独的 MSI 合并模块 (MSM) 使用。

关于c++ - 使用 Visual Studio 2012 并使用旧平台工具集进行编译?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15453629/

相关文章:

delphi - Delphi 中的异常和 DLL

c++ - grpc 的 ServerBuilder::AddListeningPort() 总是返回 TCP 端口零

javascript - 浏览器 native 注入(inject)

c# - 在 Visual Studio 2015 中创建插件

visual-studio - 如何将 OSX Xamarin 项目迁移到 Windows 10 上的 Visual Studio?

python - 导入 Dash : "ImportError: DLL load failed while importing _brotli: The specified module could not be found." 时出错

c++ - 将 node-ffi 与 Electron 一起使用无法正常工作(无法找到消息编号 0x%1 的消息文本...)

c++ - 从 C 函数调用时 C++ 函数的 undefined reference

c++ - Posix 是否为 printf/scanf 提供格式字符串宏?

c# - 当我在 Visual Studio 中发布 Azure 函数时包含文件