How to select an older compiler in Microsoft Visual C++ 2019? - c++

As written here, under "Project Settings" I should be able to specify the compiler to be used for the current project. However, I cannot find this menu entry in Visual Studio 2019.
I have both Visual C++ 2019 and 2013, and would like to use the new IDE with the old compiler. How can I do it?
Is it possible to do it with the "Community" editions?

Here are the official instructions, taken from this page:
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.
You can see a screenshot of my window below:

Related

How to create DLL project in VS2017 correctly?

I use Microsoft Visual Studio 2017 Community Edition and I want to create a C++ dll.library. I use the following manual:
https://msdn.microsoft.com/en-us/en-en/library/ms235636.aspx
However there is no manual for VS 2017, only for 2015 and below. VS 2017 haven't project type Win32 Console Application and it doesn't open Win32 Application Wizard dialog box.
How I can create C++ DLL project in VS2017?
Create the DLL project:
In this set of tasks, you create a project for your DLL, add code, and build it. To begin, start the Visual Studio IDE, and sign in if you need to. The instructions for Visual Studio 2017 version 15.3 come first. Instructions for earlier versions come later, so skip ahead if you need to.
To create a DLL project in Visual Studio 2017 version 15.3 or later
On the menu bar, choose File, New, Project to open the New Project
dialog box.
In the left pane of the New Project dialog box, expand Installed and
Visual C++ if required, and then choose Windows Desktop. In the center pane, select Windows Desktop Wizard. Enter MathLibrary in the
Name box to specify a name for the project.
Choose the OK button to dismiss the New Project dialog and start the
Windows Desktop Project wizard.
In the Windows Desktop Project wizard, under Application type,
select Dynamic Link Library (.dll).
Choose the OK button to create the project.
And To use this .dll in a client app follow this link.

Visual Studio 2010 Global VC++ Directories Redux

I am going crazy trying to change the Global VC++ Directories under Visual Studio 2010. In particular the default Includes path. I have read several articles on it, including this one, but can't seem to find where to change it.
Several articles say: "Open View|Project Manager and edit the item in the tree called Microsoft.Cpp.Win32.user". Only problem is that there is no Project Manager under the View menu nor any other menu item that I can see. At least not in VS 2010 SP1.
Below is what I see when I expand the View menu (I checked all the submenus as well).
Is there a version later than SP1 for VS 2010 C/CPP? None that I can find.
The menu you are looking for is "View\Other Windows\Property Manager". "Property Manager" is in the view menu directly in newer versions of visual studio.

How many Windows SDKs can I have installed?

In trying to debug a VS2015 MFC native C++ build problem I realized my knowledge is weak about SDKs. I just installed Update 2 for VS2015 and now the $(WindowsSDK_IncludePath) variable is set to C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt. (I didn't check this before the update.)
But I notice that in this location:
C:\Program Files (x86)\Windows Kits
I have the following folders:
8.0, 8.1, 10, NETFXSDK
Does that mean I currently have several SDKs installed right now?
I also found these folders at this location:
C:\Program Files (x86)\Microsoft SDKs\Windows
v10.0A, v6.0A, v7.0A, v7.1A, v8.0, v8.0A, v8.1, v8.1A
And if I have several SDKs installed, is it possible to target different ones for different VS2015 projects?
This link was helpful but in my project the Target Platform and Target Platform Version fields are totally blank:
How to tell Visual Studio 2015 to use the latest UCRT from Windows 10 SDK
I have not seen a good overview in the documentation and I just need a better understanding here and I appreciate any tips.
mitch
Yes, you can have multiple SDKs installed. The property pages in Visual Studio allow you to choose one. The Target Platform Version is not what you want. In the page you referenced, look further down in the property list for Platform Toolset.
The details are given in this MSDN article:
https://msdn.microsoft.com/en-us/library/ff770576.aspx
Here's the relevant part for you:
To change the project toolset
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.
If you have multiple projects/libraries, it's best if they all use the same toolset.

Visual Studio 2015 failed to create and edit c++ projects

I have a trouble with C++ projects in Visual Studio 2015 Community Edition.
First of all I cannot create new c++ project (simple console application). When I click on "OK" button in "New Project" wizard the window hide and show up again. (Nothing happened)
Second problem. When I open existing project and try to edit C++ setting I only see "Configuration Properties".
I've already tried "Repair" in VS2015 intaller and it doesn't help. Can anyone help me?
According the official site, this is a ugly and strange bug of some VS updates:
https://msdn.microsoft.com/en-us/vs-knownissues/vs2015-update3
In some cases, applying Updates to VS 2015 can cause the optional feature selections for Visual C++ (e.g. Common Tools for Visual C++ 2015) to become deselected and uninstalled. This issue can be resolved by re-selecting the required Visual C++ features in the Visual Studio 2015 setup dialog.
In "Programs and Features" (Add/Remove Programs), select "Microsoft Visual Studio 2015", then click "Change".
In the Visual Studio setup dialog, click "Modify"
Select/check "Programming Languages->Visual C++->Common Tools for Visual C++ 2015" and other features under "Programming Languages->Visual C++", as appropriate.
Click "UPDATE".

Using Visual Studio 2012 IDE, but compile with Visual Studio 2008

Where I work, we are stuck on VS2008 and will be for quite some time as converting the projects/solutions and integrating them back into our build process would take significant time; we're planning on moving to 2013 at some point though. However, I use VS2012 at home and love a lot of the features in the IDE that are missing in 2008.
I've read that you can use 2012 as an IDE and build with the 2008 compiler, but I can't find details on how this is accomplished. Any ideas? If I open one of the masterbuild files in 2012, it inevitably asks to convert them to the 2012 format, which I really don't want to do.
Thoughts? Thanks!
Yes it is possible as can be found on the Visual Studio site. However, I believe it will only give you options of the versions you have currently installed on the machine in question.
Here are the steps as laid out in the link, provided here to ensure the information link does not get broken:
(authored and published by Microsoft)
To change the target Framework
In Visual Studio, in Solution Explorer, open the shortcut menu for your project and then choose Unload project. This unloads the project (.vcxproj) file for your project.
Note: A C++ project cannot be loaded while the project file is being modified in Visual Studio. However, you can use another editor such as Notepad to modify the project file while the project is loaded in Visual Studio. Visual Studio will detect that the project file has changed and prompt you to reload the project.
On the menu bar, select File, Open, File. In the Open File dialog box, navigate to your project folder, and then open the project (.vcxproj) file.
In the project file, locate the entry for the target Framework version. For example, if your project is designed to use the .NET Framework 4.5, locate v4.5 in the element of the element. If the element isn't present, your project doesn't use the .NET Framework and no change is required.
Change the value to the Framework version you want.
Save the changes and close the editor.
In Solution Explorer, open the shortcut menu for your project and then choose Reload Project.
In Solution Explorer, open the shortcut menu for your project and then choose Properties. In the Property Pages dialog box, in the left pane, expand Common Properties and then select Framework and References. Verify that Targeted framework shows the new Framework version.
To change the project toolset
In Visual Studio, in Solution Explorer, open the shortcut menu for your project and then choose Properties.
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 want to compile with the Visual Studio 2010 toolset, select Visual Studio 2010 (v100).
Choose the OK button.
Try to use CMake. It could manage out of source build. You could create a VS2012 for edit and another VS2008 based for compiling. The source will be common.
From Visual Studio 2012 Compatibility page on MSDN
Some solutions, projects, files, and other assets that you created in
Visual Studio 2010 Service Pack 1 (SP1) will run without modification
in Visual Studio 2012, but others have to be upgraded.
If your original project is 2008 then you won't be able to use it in 2012, sorry.