Visual Studio 2015 with 2012(v110) toolset - c++

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.

Related

Visual Studio 2017 platform toolset issue

just wondering if anyone might be able to help with an issue I'm having with Visual Studio 2017. I originally had Visual Studio 2012 Ultimate installed with a valid key. Just recently I decided to just use Visual Studio 2017 Community because I'm not really using any of the features in Ultimate. After installing VS2017 Community, I uninstalled VS2012. Now, whenever I create a new project I get the error:
The "ConfigurationGeneral" rule is missing the "WindowsTargetPlayformVersion" property.
So I have to click "OK" then edit the properties of my project to use "VS 2012 (v110)" for the Platform Toolset to get anything to compile. It tells me v141 is not installed. Also my IntelliSense doesn't seem to be working at all.
If I check the VS Installer, it says I have both v140 and v141 installed, so I'm thinking it might be a path issue? I've been Googling but nothing has helped. Any help with this and IntelliSense would be appreciated, thanks.
Installed Components:
VC++ 2015.3 v14.00 (v140) toolset for desktop
VC++ 2017 version 15.9 v14.16 latest v141 tools
I tried doing a repair, but that didn't help.
This is what IntelliSense says:
`error : Designtime build failed for project '..\MyProject.vcxproj' configuration 'Debug|Win32'. IntelliSense might be unavailable.
Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate.`

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.

Using v90 (VS2008) Platform Toolset in Visual Studio 2015

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

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

Visual Studio 2013 cannot convert VS 2012 C++ Projects

All my C++ Visual Studio 2012 projects cannot be upgraded by VS 2013 Professional Update 2, microsoft tells that you also need to have VS2012 installed in order to open VS 2012 projects.
The problem is that I have installed VS2012 and still get the same error.
after each project name in VS 2013 I have (Project incompatible), I want to convert the projects to VS2013 because I don't want to use VS2012 anymore.
Unsupported
This version of Visual Studio is unable to open the following projects. The project types may not be installed or this version of Visual Studio may not support them.
For more information on enabling these project types or otherwise migrating your assets, please see the details in the "Migration Report" displayed after clicking OK.
No changes required
These projects can be opened in Visual Studio 2013, Visual Studio 2012, and Visual Studio 2010 SP1 without changing them.
and this is the error in migration report
The application which this project type is based on was not found.
I found somewhere on a forum that if you install VS 2012 SDK it should work, but the VS2012 SDK cannot be installed because it cannot find Visual Studio 2012