C++ Visual Studio 2013 msvcr120 到 msvcr100

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19706421/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 23:04:09  来源:igfitidea点击:

Visual Studio 2013 msvcr120 to msvcr100

c++dllvisual-studio-2013msvcr100.dll

提问by BennX

Is it possible to change the restrib file to msvcr100 so other computers can run the program without having problems with the .dll file? If so how do i get that?

是否可以将 restrib 文件更改为 msvcr100,以便其他计算机可以运行该程序而不会出现 .dll 文件问题?如果是这样,我如何得到它?

I do compile the program and other people can't use it because of the missing msvcr120.dll file. So it would be great if i could change that somehow.

我确实编译了该程序,但由于缺少 msvcr120.dll 文件,其他人无法使用它。所以如果我能以某种方式改变它会很棒。

Is it possible to install the Plattformtoolset without a older Visualstudio version?

是否可以在没有旧版 Visualstudio 的情况下安装 Plattformtoolset?

回答by Baldrick

You have a few choices:

你有几个选择:

  1. Install VS2010 on the machine, and set the Platform Toolset option to v100.
  2. Install the Windows SDK v7.0A from here, which SHOULD / CAN add a new option to your Platform Toolset menu in VS2013. Getting this to work can be quite fiddly though. (It's rarely worked for me right out of the box). Note if you use MFC in your application, this option isn't any good for you - MFC libraries are not included with this SDK.
  3. Get your users to install the Microsoft VS 2013 C++ Redistributable Package from here, and carry on regardless.
  4. Statically link to the VS2013 runtimes, instead of using dynamic linking to the runtime DLLs. You can set this in the IDE through project settings under C/C++ > Code Generation > RunTime Library > Multi-threaded (/MT)or (/MTd). All the needed code will be compiled into your app, which will make the files bigger, but will avoid the issues you mention.
  1. 在机器上安装VS2010,将Platform Toolset选项设置为v100。
  2. 这里安装 Windows SDK v7.0A ,它应该/可以在 VS2013 的平台工具集菜单中添加一个新选项。尽管如此,让它工作可能非常繁琐。(开箱即用很少对我有用)。请注意,如果您在应用程序中使用 MFC,则此选项对您没有任何好处 - 此 SDK 中不包含 MFC 库。
  3. 让您的用户从这里安装 Microsoft VS 2013 C++ Redistributable Package ,并继续进行。
  4. 静态链接到 VS2013 运行时,而不是使用动态链接到运行时 DLL。您可以在 IDE 中通过C/C++ > Code Generation > RunTime Library > Multi-threaded (/MT)或下的项目设置进行设置(/MTd)。所有需要的代码都将编译到您的应用程序中,这将使文件更大,但会避免您提到的问题。

回答by Angew is no longer proud of SO

In Project > Properties > General, there is a setting called Platform toolset. You can use that to change the version of the build toolchain used.

在 中Project > Properties > General,有一个名为 的设置Platform toolset。您可以使用它来更改所使用的构建工具链的版本。

screenshot

截屏

回答by crashmstr

One thing to consider in regards to changing the platform toolset: it changes the compiler, so C++ features newerthan Visual Studio 2010 will not compile. It also requires the other version to be installed.

关于更改平台工具集需要考虑的一件事:它会更改编译器,因此比 Visual Studio 2010更新的C++ 功能将无法编译。它还需要安装其他版本。

The bestway to handle this would be to give them the Visual C++ Redistributable for Visual Studio 2013.

处理此问题的最佳方法是为他们提供Visual C++ Redistributable for Visual Studio 2013

You could either have them do it themselves, or make an installer.

您可以让他们自己完成,也可以制作安装程序。