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

问题

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

I'm using Visual Studio 2012 to develop C++ DLLs. On some machines these DLLs can not be loaded, because the platform toolset, which is set to "v110" is missing.

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

I have tried to install older c++ runtimes. They didn't install because "a newer version is already installed". I also installed the current Windows SDK, but there are still no other items to choose from than v110.

问题

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

How can I compile my C++ DLL with an older version of the C++ runtime so it will run on non-developer machines?

推荐答案

根据 此页面MSDN,您需要有相应版本的Visual Studio(2008或2010),或者平台工具集"下拉列表中列出这些版本的相关Windows SDK:

According to this page on MSDN, you need to have the corresponding version of Visual Studio (2008 or 2010), or the relevant Windows SDK for the "Platform Toolset" drop down to list those versions:

要更改目标平台工具集,您必须安装相关版本的 Visual Studio 或 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"来使其可用.

You also seem to be a little bit confused between "Platform Toolset", which controls which compiler/linker/etc. is used to build your application, and "Visual C++ Redistributable", which is needed to run your application. You can't install a "Platform Toolset" on a user's PC, and nor will you make one available by installing a particular "Visual C++ Redistributable" on your development PC.

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

Also, as far as I know, the Visual C++ Redistributable doesn't include the MFC runtimes. They're available as a separate MSI merge module (MSM).

相关文章