is it possible to install v140 build tools in visual studio 2013? if yes then how? - c++

I want to install v140 build tools in visual studio 2013, as my project has been upgraded to vs 2015. I dont want to install vs 2015. is there a way to install v140 in vs 2013. Thanks

I tried to install the build tools, but the installation failed. I asked the same question on the MSDN forums and was told that VS is backward compatible but not forward compatible with build tool installs.
So, no—it is not possible to install v140 of the build tools on VS 2013, as this is an older version of Visual Studio than v140.

No, it is not possible!
It is that simple, but I am forced to write at least 30 characters.

You can download and install the Visual C++ 2015 build tools from here.
You can then change your toolset (as described here):
Right click your project, go to Properties.
Under Configuration Properties, go to General.
Change your Platform Toolset to one of the
available ones.

Related

How add to Visual Studio 2017 or 2019 old C++ (v110) compiler?

I need compile my C++ project with old compiler verison. I saw, that is possibly to add to new visual studio old compiler. I try to download and install some build kit and remote utility for VS 2020 (ver v110), but nothing changed. I expect in properties - platform toolset - new line - v110, but nothing happen.
What I shloud to download and install and what to do?
You could install VS2012 platform toolset. In fact, you don't need to uninstall the redistributables. It's just that there may be installation errors.Also, if you unstall them, you could re-install them in Microsoft Downloads.
Then, you could change v110 in properties -> platform toolset.
For the previous version of VS2012, you can go to download it on daffodil website.
You need to install the old Visual Studio 2012 to use the compiler in a newer Visual Studio (e.g. 2017). Therefore uninstall the redistributables ("Microsoft Visual C++ 2012 Redistributable") to avoid errors.
Then you have to install the old Visual Studio 2012 and it's updates if required.
Afterward you will probably have to "repair" the newer Visual Studio Installations.

TFS 2018 build fails: cannot open include file 'afxres.h'

We are testing a new new TFS 2018 SP1 server.
I was previously building a solution (4.5) which contains two unmanaged C++ projects originally written against the 2012 toolset.
Building that solution as-is on the new server worked fine. However, we have decided to retarget to 4.7.1 for our next release.
After making all the changes in the projects including targeting the 4.7.1 framework and the 2017 toolset (141), these projects fail to build with the error in the title.
I know this has to do with the C++ MFC/ATL redist.
The build server does not have VS 2017 installed and I do not want to install it unless absolutely necessary.
I did install the VS 2017 C++ redists x86 and x64 but it did not correct this.
Can anyone help me on that?
You need to at least install Build Tools for Visual Studio 2017 on your build server.
Build Tools for Visual Studio 2017
These Build Tools allow you to build native and managed MSBuild-based
applications without requiring the Visual Studio IDE. There are
options to install the Visual C++ compilers and libraries, MFC, ATL,
and C++/CLI support, and .NET and .NET Core support.
If that still not work, I'm afraid that you have to install the VS 2017 on the build server. (Note that do not miss the feature Microsoft Foundation Classes for C++ .)
UPDATE:
Please double check if you missed the Microsoft.VisualStudio.Workload.VCTools workload on the build server. See Visual C++ build tools for details.
If missed , just try using below command to install it:
vs_buildtools.exe --add Microsoft.VisualStudio.Workload.VCTools

Visual Studio Platform 2015 Toolset ='v141' cannot be found

I'm trying to compile a project using OpenFrameworks (a library which uses C++) in Visual Studio. The build is set to Release and X64 and in the project properties I have set the Platform Toolset to Visual Studio 2015 (v140)
However every time I try to build the project I get the same error (amongst others)
Error MSB8020 The build tools for v141 (Platform Toolset = 'v141')
cannot be found. To build using the v141 build tools, please install
v141 build tools.
I know v141 is from the new version of MSVS 2017 but I do not want to upgrade to as the new version is not compatible with OpenFrameworks. I have tried rebuilding the project from scratch several times and have also looked into the VCXPROJ file and verified that everything is set to V140 - and it is. All very bizarre.
It seems that on build, something is setting a requirement for v141 but I cannot seem to find where this is coming from. Does anyone have an idea?
I had such an issue. The solution is: open menu "Project"->Properties->Configuration Properites->General - and choose platform toolset v140.
Had this same error trying to npm install after cloning a node based project. It had an npm dependency that required C++ source to be compiled.
I had already modified my VS2017 install to include Individual Components -> VC++ 2017 version 15.7 v14.14 latest v141 tools
but that didn't help.
I applied these commands in succession
npm install -g node-gyp
npm install --global --production windows-build-tools
The first had no effect but the second did the trick and the npm install command completed successfully after that.
This was addressed in the comments of one of the answers, but it worked for me. I had both v140 and v141 build tools installed, so when I had to use v140 build tools for something, I set the VCTargetsPath variable to the path of the v140 build tools. Deleting this variable in my environment variables ultimately fixed this issue for me.
For this error, and similar, for other platforms (e.g. VS2013) this problem typically occurs because you installed an older version of VS after you installed a later one. It's my observation that this will effect all of your Visual Studio C++ projects, and you will have to manually set them to target the specific toolset for the given version of VS you are trying to build the project under.
If anyone has the same issue..
Reason: When someone tries to open existing solution which created/build on latest VS version (VS2015 / 2017) and tried to open with backward / old version of VS instance. Then this error might occur.
Please try below steps.
Right click Project->Properties->Configuration Properties.
Set 'Target Platform Version' as Supported OS version, i.e. for 8.1 > Win7 & 10 Win10
Set 'Platform tool set' as installed visual studio version.
Re-Build & Enjoy :)
I had that v141 error when building from command-line but not inside visual studio:
The build tools for v141 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install v141 build tools. 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".
Turns out it was because I was calling the wrong vcvars so I was using the wrong version of msbuild.exe:
:: wrong (Visual Studio 2015)
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 >NUL
:: correct (Visual Studio 2017)
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvars64.bat" x64 >NUL
Not sure it's possible for this to be the error inside visual studio, but I hope this is helpful to some future searcher...

MSbuild Error: The builds tools for v140 (Platform Toolset = 'v140') cannot be found

I have a solution which is consists of a large number of projects (C++ and C#). I upgraded the solution to VS2015, so the toolset version for most of them are now set to V140, but a small number of projects need to remain in V110 (third party libraries, etc). When I build the solution in Visual Studio 2015, it builds just fine, but when TeamFoundationServer tries to build it, it fails with the following error:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets (44): The builds tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install v140 to build using the v140 build tools.
I tried to specify the VisualStudioVersion or the path to the right MSBuild version as build arguments, but it didn't work as the rest of the projects (the ones in V110) will be in trouble.
Any help would be very appreciated.
I had the same issue. Steps given in this Solution helped me solve my issue. Repeating the steps here for future reference.
If you're attempting to build a Win32 "Desktop" application, the easiest way to get the v140 Platform Toolset is via the Visual Studio Installer (please see the image, below, for an illustration of steps '3.' and '4.'):
Launch the "Visual Studio Installer" from your start menu.
Select "Modify" for the instance of Visual Studio 2017 you have
installed.
Under the "Summary" pane of the workload selector, click the
"Desktop development with C++" expander (if it is collapsed)
Check the "VC++ 2015.3 v140 toolset (x86,x64)" optional feature.
The builds tools for v140 that's the platform toolset for VS2015.
If you are using TFS2015, you must make sure the build environment on your build machine be the same as your local developer machine. You should install VS2015 on your build machine.
If you are using TFS2013 or TFS2012, most probably MSBuild 12.0 is called.You need to set the build templates to point to MS Build version 14.0. For the details, check: TFS 2013 building .NET 4.6 / C# 6.0
Jacob's answer worked for me but C++ build tools were under VS Build Tools 2017 while I had VS 2019 Installer on Windows 10 as at July, 2019.
You're trying to build using a different version of the build toolset that is either not installed on your system or that the project can't use. To change it to something that you have installed on your system, right click on the project in your Solution Explorer.
Go to Properties. Configuration Properties>General>Platform Toolset>(Change this to a toolset that is installed on your system).
Make sure you do this for the Debug and Release builds
For the folks who are trying to do the same with Visual Studio Build Tools 2022, you may find this under Optional when choosing Desktop development with C++ Workload. Also, I had to update below variables in Environment variables to point to the new location.
Path: replace previous path for BuildTools with C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin
VCTargetsPath: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170
VS140COMNTOOLS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ PS: I didn't have to change the value. But this setting was needed for me to work.
If you are using Visual Studio 2022 Build Tools, then the following PowerShell script will fix it:
$VS_BTOOLS_EXE="vs_buildtools.exe"
$VS_BTOOLS_URI="https://aka.ms/vs/17/release/vs_buildtools.exe"
Invoke-WebRequest -Uri $VS_BTOOLS_URI -OutFile $VS_BTOOLS_EXE
Start-Process -FilePath ./vs_BuildTools.exe -ArgumentList `
"--add", "Microsoft.VisualStudio.Component.VC.140", `
"--quiet", "--norestart", "--force", "--wait" -Wait -PassThru
Useful when silent installation is needed as well.
Jacob's answer worked for me, but I had to click on the "Individual components" tab at the top for my Step 3.
image
This solution worked perfectly for me: https://social.msdn.microsoft.com/Forums/vstudio/en-US/e0b9c601-2ece-4dcc-bac3-23ed7dd6801a/the-builds-tools-for-v120-platform-toolset-v120-cannot-be-found?forum=vclanguage

What I need to install to compile for Platform Toolset v100 using Visual Studio 2013?

I've just formatted the PC and have Visual Studio 2013 installed. Now, I would like to compile a Visual Studio 2010 C++ solution without convert it and continue targeting v100 platform toolset.
I get the this error:
error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...". C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets 64 5 TPC30004
and project properties I see that of course I miss the needed toolset.
I can't change the target because cannot force XP users to install the new C++ 2013 re-distributable so probably I should install Visual Studio 2010 to fix the problem, but if possible I would like to avoid it (small SSD at the moment and not much free space).
Are there other options available?
You will need to install the Visual Studio 2010 for that. There is no alternative.
You still can install to a different drive, to keep memory footprint on C: as low as possible.
There's also the option of installing the Windows SDK 7.1, which comes with the same VS2010 Platform Tools in it and is available for free. Unlike the VS2010 Express edition, it also includes the AMD64 (but not the Itanium) version of the tools.