简体   繁体   English

如何在Visual Studio 2015社区上安装Visual Studio Build Tools 2010?

[英]How to install Visual Studio Build Tools 2010 on Visual Studio 2015 Community?

I have a project created on Visual Studio 2010. When I try to run the project on Visual Studio 2015 Community edition I get the error below, 我在Visual Studio 2010上创建了一个项目。当我尝试在Visual Studio 2015社区版上运行该项目时,我收到以下错误,

Severity Code Description Project File Line Error MSB8020 The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. 严重级代码说明项目文件行错误MSB8020找不到Visual Studio 2010(Platform Toolset ='v100')的构建工具。 To build using the v100 build tools, please install Visual Studio 2010 build tools. 要使用v100构建工具进行构建,请安装Visual Studio 2010构建工具。 Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". 或者,您可以通过选择“项目”菜单或右键单击解决方案,然后选择“重新定位解决方案”来升级到当前的Visual Studio工具。 graphics C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\V140\\Microsoft.Cpp.Platform.targets 55 graphics C:\\ Program Files(x86)\\ MSBuild \\ Microsoft.Cpp \\ v4.0 \\ V140 \\ Microsoft.Cpp.Platform.targets 55

And when I tried to build it with Visual Studio 2015 Build Tools I encountered about 1500+ errors. 当我尝试使用Visual Studio 2015 Build Tools构建它时,我遇到了大约1500多个错误。

在此输入图像描述

Is there any way to make the project work? 有没有办法让项目有效?

If you can't install VS2010, Windows SDK for Windows 7 contains needed compiler tools (v100), you may actually skip installing the SDK itself and install only the compiler tools, headers and libs. 如果您无法安装VS2010, Windows SDK for Windows 7包含所需的编译器工具(v100),您实际上可能会跳过安装SDK本身并仅安装编译器工具,标头和库。 Please note, that the compiler included in Windows SDK is the same that VS2010 has, but VS2010 SP1 has a bit newer compiler. 请注意,Windows SDK中包含的编译器与VS2010相同,但VS2010 SP1的编译器更新一些。 If you need that, you'll also need to install Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1 . 如果需要,还需要为Windows SDK 7.1安装Microsoft Visual C ++ 2010 Service Pack 1编译器更新 But be aware, that if you install these, you may have issues later if you decide to install VS2010, there are bugs in installer that requires you to install components in strict order. 但请注意,如果您安装这些,如果您决定安装VS2010,则可能会遇到问题,安装程序中存在需要您按严格顺序安装组件的错误。 Also, if your code uses MFC or ATL you must install VS2010, installing Windows SDK will not be enough. 此外,如果您的代码使用MFC或ATL,您必须安装VS2010,安装Windows SDK是不够的。

You either install VS 2010 and build your project, or better yet you upgrade your projects. 您可以安装VS 2010并构建项目,也可以更好地升级项目。 The VS 2015 custom install options will let you install the v120 Platform Toolset, but not the v110 or v100 Platform Toolsets. VS 2015自定义安装选项将允许您安装v120平台工具集,但不能安装v110v100平台工具集。

One major change in VS 2015 is that the C++ tools (ie v140 ) are not installed by the Typical installation option . VS 2015的一个主要变化是典型安装选项未安装 C ++工具(即v140 )。 See the Visual C++ Team Blog . 请参阅Visual C ++团队博客

Keep in mind that Visual C++ 2010 used the C++0x Draft Standard, and Visual C++ 2015 meets the C++11 Standard with the exception of Expression SFINAE (which is partly there in Update 1 ), so quite a bit has changed in the intervening years including some breaking changes. 请记住,Visual C ++ 2010使用C ++ 0x草案标准,而Visual C ++ 2015符合C ++ 11标准,但表达式SFINAE(部分存在于Update 1中 )除外,因此有相当多的变化。中间年份包括一些重大变化。 Since you are jumping three major releases at once--and about 10 minor updates--, it can be a bit overwhelming especially working through all the new warnings. 由于您一次跳过三个主要版本 - 大约有10个小更新 - 所以它可能有点压倒性,特别是在处理所有新警告时。

Another thing to keep in mind is that Visual C++ 2010 used the Windows 7.1 SDK, while Visual C++ 2012 or later use the Windows 8.x SDK. 另外要记住的是Visual C ++ 2010使用Windows 7.1 SDK,而Visual C ++ 2012或更高版本使用Windows 8.x SDK。 There's been a lot of change there too particularly for DirectX development. 对于DirectX开发来说,特别是有很多变化。 It's particularly important for Windows desktop apps that you set the _WIN32_WINNT preprocessor define for your target platform as the Windows 8.x SDK does not default to the 'oldest supported platform' like earlier Windows SDKs did. 对于Windows桌面应用而言,为目标平台设置_WIN32_WINNT预处理器定义尤为重要,因为Windows 8.x SDK不像以前的Windows SDK那样默认使用“最早支持的平台”。 See Using the Windows Headers 请参阅使用Windows标头

VS 2010 and the v100 toolset supports targeting Windows XP and Windows Server 2003. The v140 toolset does not support targeting Windows XP / Server 2003. You have to use v140_xp Platform Toolset instead. VS 2010和v100工具集支持定位Windows XP和Windows Server v140工具集不支持定位Windows XP / Server 2003.您必须使用v140_xp平台工具集。 See this post for some notes as this means you are again using the Windows 7.1 SDK rather than the Windows 8.x SDK with the _xp toolsets. 请参阅此文章以获取一些注意事项,因为这意味着您再次使用Windows 7.1 SDK而不是带有_xp工具集的Windows 8.x SDK。

See Breaking Changes in Visual C++ 2012 , Breaking Changes in Visual C++ 2013 , and Breaking Changes in Visual C++ 2015 . 请参阅Visual C ++ 2012中的重大更改,Visual C ++ 2013中的 重大更改以及Visual C ++ 2015中的重大更改

See also Support For C++11/14/17 Features (Modern C++) , and Where is the DirectX SDK? 另请参阅支持C ++ 11/14/17功能(现代C ++) ,以及DirectX SDK在哪里? .

If you need to build the code both with VS 2010 and with VS 2015, then you should create two projects/solution files, one for each. 如果您需要使用VS 2010和VS 2015构建代码,那么您应该创建两个项目/解决方案文件,每个文件一个。 You may also want to read this article for some notes on writing code that can build with multiple Visual C++ toolsets, which again is particularly challenging due to the Windows SDK changes. 您可能还想阅读本文,了解有关编写可以使用多个Visual C ++工具集构建的代码的一些注意事项,由于Windows SDK的更改,这一点尤其具有挑战性。

VS 2015 supports targeting Windows Vista SP2, Windows 7 SP1, Windows 8.0, Windows 8.1, Windows 10, and optionally Windows XP SP3. VS 2015支持Windows Vista SP2,Windows 7 SP1,Windows 8.0,Windows 8.1,Windows 10和Windows XP SP3。 It does not support targeting Windows Vista RTM, Windows Vista SP1, or Windows 7 RTM. 支持定位Windows Vista RTM,Windows Vista SP1或Windows 7 RTM。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM