Using v90 (VS2008) Platform Toolset in Visual Studio 2015 - c++

Is it possible (and how) to use VS2015 IDE to build native C++ projects using the compiler, linker, the STL and everything else that comes with VS2008?
What I'm trying to do is called "C++ Native Multi-Targeting" and is known that e.g. VS2012 allows usage of VS2008 (v90) toolset, for C++ projects, via Project Properties->Configuration Properties->General->Platform Toolset=v90. Normally, out-of-the-box v90 will not be available, but will appear if you make side-by-side installations of VS2008+VS2010+VS2012 or VS2008+win7.1sdk+VS2012.
But I couldn't find so far any reported attempts at bridging the bigger gap between vs2008 and vs2015 for C++ projects. According to MSDN it seems that officially it's not supported. But I'd like to know if it might work anyway.
for reference, platform toolset values are:
Visual Studio .NET 2002 (Platform Toolset = 'v70')
Visual Studio .NET 2003 (Platform Toolset = 'v71')
Visual Studio 2005 (Platform Toolset = 'v80')
Visual Studio 2008 (Platform Toolset = 'v90')
Visual Studio 2010 (Platform Toolset = 'v100')
Visual Studio 2012 (Platform Toolset = 'v110')
Visual Studio 2013 (Platform Toolset = 'v112')
Visual Studio 2015 (Platform Toolset = 'v114')

It should be possible. I have tried it but MSBuild fails with the following message:
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(57,5): error : Required file "" is missing.
The only solution I have found so far was to add the following line in vcxproj file:
<PropertyGroup Label="Globals">
...
<TrackFileAccess>false</TrackFileAccess>
</PropertyGroup>
Disadvantage: Always a complete build for every change

Related

Compiling using MSBuild 12.0 from Microsoft Visual Studio 2015

I have a solution that was compiled with MSVC 12.0 Visual Studio 2013 (C++/CLI and C#) but only have Visual Studio 2015 (Community). I want to build the project using MSVC 12.0 as it was intended, as I only need to rebuild 1 part of the solution (of 5) for my purpose and want it to be compatible with the other DLLs. When trying to build it from MSVC 14.0 (Visual Studio 2015) it says:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v120 (Platform Toolset = 'v120') cannot be found.
Of course I installed the MS Build tools for 2013 (MSVC 12.0, v120) from here: https://www.microsoft.com/en-us/download/details.aspx?id=40760 as well as the Microsoft Visual C++ Redistributable 2013 package.
And the right directory for the 12.0 build tools install is C:\Program Files (x86)\MSBuild\12.0\Bin\amd64
It looks like a configuration error on the solution (or in Visual Studio in general) since it is looking for the build tools in the wrong directory. Does anyone know what settings I need to change / add in Visual Studio to get it to compile with MSBuild 12.0 instead of 14.0? I'd prefer not to install Visual Studio 2013 since I don't use it for anything else (just want to have the option to use VS 2013 MSBUILD within VS 2015 as needed).
Okay I have gotten this working although in a roundabout way. Thanks others that have answered and commented. Sign up for a Microsoft Visual Studio Dev Essentials subscription for free. https://azure.microsoft.com/en-us/pricing/member-offers/vs-dev-essentials/ Then you can go through the menus and download Visual Studio Community 2013 by going to this link and finding it https://my.visualstudio.com/downloads. After doing so, you can build MSVC 12.0 from Visual Studio 2015. Sure, not perfect, but it works. I haven't tried uninstalling Visual Studio 2013 to see if it still works (Windows Phone SDK 8.1 is installed with 2013 as was mentioned to get it working in the Enterprise version of 2015) but if you could somehow keep that and remove the 2013 edition I believe it could work without 2013 installed...
If you go to the top of your .vcxproj change it to this
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Then your .sln can still open in Visual Studio 2015
VisualStudioVersion = 14.0.25420.1
The reason is because the compiler version is specified on a project-by-project basis, and will override the solution version.
I'd prefer not to install Visual Studio 2013 since I don't use it for anything else (just want to have the option to use VS 2013 MSBUILD within VS 2015 as needed).
You can install VS2013 toolset version from your VS2015 installer without installing visual studio 2013. From the 2015 installer, select Windows 8.1 and Windows Phone 8.0/8.1 Tools and common Tools for Visual C++ 2015:
After installation completed, you will find the platform Toolset below:
Then you can built your project with platform toolset Visual Studio 2013(v120).
You can refer to more info from the similar question on SO.

Visual Studio 2015 with 2012(v110) toolset

I am trying to build an application (Qt specifically) in Visual Studio 2015 but using 2012 toolset (cause 2015 redistributable requires Windows update where my client does not want to do that). I've try to change the project properties->Configuration properties->Platform Toolset to Visual Studio 2012 (v110) and modify the .vcxproj file as image below.
but when i try to compile the project error occurs.
Following the error, in the Microsoft.CppCommon.targets file, the error shows at this line.
<CL Condition="'%(ClCompile.PrecompiledHeader)' != 'Create' and '%(ClCompile.ExcludedFromBuild)'!='true' and '%(ClCompile.CompilerIteration)' == ''"
Have totally no idea what error is it about.
Need some help here..
Using v140(2015) toolset compile successfully.
One day I read to be able to switch Platform toolset you had to install the corresponding Visual Studio version. and then in vs2015 you are able to switch to v120 or v100 regarding if you had installed VS 2012 or VS2010.
Regarding this post :
https://msdn.microsoft.com/en-us/library/ff770576.aspx
Maybe you can do the trick with just installing SDK.

What is "Platform Toolset" setting in visual studio project

I have three doubts. Anyone there for help?
What is the "Platform Toolset" project setting in VS project
Why such setting required
What happen, if I change the setting (v110 to v100)
It is an MSBuild property that controls the specific version of the platform toolset that you want to use.
More info here: http://msdn.microsoft.com/en-us/library/windows/hardware/hh454232%28v=vs.85%29.aspx
Most likely you want to use the last stable Windows SDK. You can check the toolset that you are using looking at your Visual Studio project file (.vcxproj), looking for this XML entry:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"
Label="Configuration">
<ConfigurationType>Driver</ConfigurationType>
<DriverType>KMDF</DriverType>
<PlatformToolset>WindowsKernelModeDriver8.1</PlatformToolset>
</PropertyGroup>
Moreless it is a version of toolchain that is used to build your project. So depends on version you have selected, different compiler, linker (etc) versions are used. If you select toolset version that was released with VS2017 (v141), MSBuild will use tools from this toolset do build your project.
It is nicely described under link provided by: YoavKlein.
"The platform toolset consists of the C++ compiler (cl.exe) and linker (link.exe), along with the C/C++ standard libraries. Since Visual Studio 2015, the major version of the toolset has remained at 14, which means that projects compiled with Visual Studio 2019 or Visual Studio 2017 are ABI-backwards-compatible with projects compiled with Visual Studio 2015. The minor version has updated by 1 for each version since Visual Studio 2015:
Visual Studio 2015: v140
Visual Studio 2017: v141
Visual Studio 2019: v142"
So there is no difference in ABI if the major version is same (but in your case you ask about change from v110 to v100 so the compatibility may be broken), but it may happen that f.e. compiler provided with older version of toolset does not implement some features of the new or incomming c++ standard etc.
It is the version of all the tools used to compile and link your project.
The mapping between PlatformToolset and Visual Studio versions is as follows
Visual Studio 2012: v110
Visual Studio 2013: v120
Visual Studio 2015: v140
Visual Studio 2017: v141
Visual Studio 2019: v142
Visual Studio 2022: v143
(v130 was skipped)
Taken from
https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/platform-toolset
https://learn.microsoft.com/en-us/cpp/build/how-to-modify-the-target-framework-and-platform-toolset?view=msvc-170
https://marcofoco.com/blog/2015/02/25/microsoft-visual-c-version-map/
In Visual Studio, in Solution Explorer, open the shortcut menu for your project (not for your solution) and then choose Properties to open your project Property Pages dialog box.
In the Property Pages dialog box, open the Configuration drop-down list and then select All Configurations.
In the left pane of the dialog box, expand Configuration Properties and then select General.
In the right pane, select Platform Toolset and then select the toolset you want from the drop-down list. For example, if you have installed the Visual Studio 2010 toolset, select Visual Studio 2010 (v100) to use it for your project.
Choose the OK button.
I Would refer to this link, i think it's explained better there:
https://learn.microsoft.com/en-us/cpp/build/how-to-modify-the-target-framework-and-platform-toolset?view=vs-2019

Use vc100 platform toolset without installing Visual Studio 2010?

A while ago I was able to install the vc90 platform toolset via Windows SDK v6.0a and use it in my Visual Studio 2013.
I now need to use the vc100 toolset and cannot find where it is integrated? Is there a way to use the vc100 toolset without installing Visual Studio 2010?
The vc100 toolset is part of SDK v7.0a.

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.