how to make the same project solution work on both visual studio 2015 and 2017? - c++

I am using Microsoft visual studio 2015 and my friend using visual studio 2017, we both are working on single c++ project, if i take his code into my studio it shows errors,
I want the same solution and same project file into my MSVS 2015 but he has version 141 and I have v140,
Is there any way to make the same project solution work on both visual studio 2015 and 2017.
I heard it's possible with externalizing targeting parameters. But i don't know much about it.
Please give me any information about that.

Related

I upgraded C++ projects from Visual Studio 2010 to 2015 still its showing Visual Studio (2010)

The configuration window image. Just click on it.
I upgraded C++ projects from Visual Studio 2010 to Visual Studio 2015, but it's still showing (Visual Studio 2010) in the Solution Explorer.
Please inform me if there is any change I need to do to solve this error.
This is displayed in the Solution Explorer:
This is not an error, it simply means that the project is using the toolkit that came with Visual Studio 2010. This doesn't prevent your projects from being compiled however.
To upgrade the project to the Visual Studio 2015 toolkit right click on the projects showing (Visual Studio 2010) and select the desired toolkit under General->Platform Toolset.

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.

Is it possible to apply fixes on Visual C++ Build Tools 2015 Update 3

Visual Studio 2015u3 is serviced by cumulative updates with KB3165756, which contains, among other things, fixes to the C++ compiler and libraries.
However KB3165756 refuses to do anything on a computer where Visual C++ Build Tools 2015 Update 3 is installed. It really wants one of VS Pro, Enterprise, Community or Express.
Are there special patches for Visual C++ Build Tools, or is it not updated at all and so it is actually a better idea to switch to Visual Studio Express 2015 for Desktop, in order to be able to receive patches?
Here is the answer I got on MSDN Visual Studio Development > Visual Studio Setup and Installation forum:
However KB3165756 refuses to do anything on a computer where Visual C++ Build Tools 2015 Update 3 is installed. It really wants one of VS Pro, Enterprise, Community or Express.
It is reasonable, check this: https://msdn.microsoft.com/en-us/library/mt752379.aspx and it describes this update is applies to
Visual Studio Professional 2015
Visual Studio Enterprise 2015
Visual Studio Community 2015
Visual Studio Express 2015 for Web
Visual Studio Express 2015 for Desktop
Visual Studio Express 2015 for Windows 10
I have researched around and it looks like there is no special update for the Visual C++ Build Tools 2015, and refer to this blog: https://blogs.msdn.microsoft.com/vcblog/2015/11/02/announcing-visual-c-build-tools-2015-standalone-c-tools-for-build-environments/
The latest release of the Visual C++ Build Tools 2015 is here: Download Visual C++ Build Tools 2015
If you still want to install, it looks like you need a VS 2015 RTM update version on your computer. Since the VS community 2015 with update 2 and Visual Studio Express version are free and you can think about it.
Best regards,
Sara

Visual Studio 2013 compile like visual studio 2008

I have C++ VS2008 project and my lovely IDE VS13. How can I work into VS13, but compile and debug project like in would be VS08. When I open VS2008 *.sln files that wrote to me about one-way upgrade, and how you i guess you understand, project after open in vs2013 don't open in vs2008.
For now, I use VS13 like notepad then copy all files text to alt+tab opening VS 2008 IDE and there are run project. And again work in VS13.
Based on Microsoft product lifecycle policies,
https://support.microsoft.com/en-us/lifecycle/search?sort=PN&alpha=Visual%20Studio&wa=wsignin1.0
Visual Studio 2008's mainstream support ended in April 2013, while Visual Studio 2013 was released in Jan 2014. That means Visual Studio 2013 will not support Visual Studio 2008 bits, so not a surprise if native multi targeting does not show v80.
I don't think you can easily get side by side, as VS2008 is too old, and its C++ project is not even MSBuild script. Once converted to VS2013, there is no way back.
Why cannot you just let VS2008 go? I guess that's why you get so many down votes.
You can't convert the solution to Visual Studio 2013 and still open it in Visual Studio 2008. You can, however, tell Visual Studio 2013 to use the Visual Studio 2008 compiler.
To do that, convert your solution to Visual Studio 2013 (don't forget to keep a copy of the original file, just in case), then open the project properties, go to the General options and select the Visual Studio 2008 platform toolset.

what compiler does visual studio 2012 use for C++ and is it compatible/can I use it with codeblocks?

What compiler does visual studio 2012 use for C++ and is it compatible/can I use it with codeblocks?
I want to know because we're required to use Visual Studio 2012 for this school project and I would like to be able to trial some things with codeblocks.
Visual Studio 2012 is using the Microsoft compiler cl.exe. But anyway, you can maintain two projects (one for Visual Studio and one for CodeBlocks) - sharing the same source code.