简体   繁体   中英

Visual studio not running program because it needs v120 tools

I made a simple C++ paint program in Visual Studio 2013. The program worked and ran in VS 2013. I moved the program to a new computer and ran it. This computer has visual studio 2015, so when I tried to run it, it said I needed v120 build tools. Can someone explain how to install these tools?

You need to change the project settings to use toolset v120

Go here and scroll down to where it says "To change the project toolset".

Each release of Visual Studio ships with its own set of compilers, tools, etc. Visual Studio 2015 is also known as Visual Studio version 14.0 and uses (by default) the v140 Platform Toolset. Visual Studio 2013 is also known as Visual Studio version 12.0 and uses the v120 Platform Toolset.

Since your C++ project was originally created by Visual Studio 2013 it is configured to use the v120 Platform Toolset. When you opened that project with Visual Studio 2015 you probably were offered a chance to upgrade the project to the v140 Platform Toolset. It sounds like you declined that option since your build is still asking for the v120 build tools.

One option would be to go into the C++ Project Properties General Tab (not the Solution Properties) and change the Platform Toolset to Visual Studio 2015 (v140) . That tab does exist in the Community Edition.

If you do that you'll be building with the Visual Studio 2015 compilers and tools instead of the Visual Studio 2013 compilers and tools used on your old computer. That does mean there's a chance that you'll encounter a C++ Breaking Change . Probably a small chance but that would depend on how your program is written and the features it uses.

It also means the program built on your new computer will be different from the program built on your old computer since the two builds will be using different versions of the compilers and tools.

If you absolutely want/need compatibility between your two computers then you'll need to leave the Platform Toolset at Visual Studio 2013 (v120) which brings us back to the question you originally asked.

One way to get the v120 tools would be to install Visual Studio 2013 on your new computer. But I'd be reluctant to do that. I'm sure Microsoft have tested installing Visual Studio 2015 on top of Visual Studio 2013. I'm not so sure they'll have tested the other way around (although they are very thorough).

Update

To install the v120 Platform Toolset on a system with Visual Studio Community 2015 installed, run setup from Programs and Features and then check the "Tools and Windows SDKs" box under "Windows 8.1 and Windows Phone 8.0/8.1 Tools".

社区2015设置的屏幕截图

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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