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.
Related
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:
I downloaded the visual studio 2017 with c# and xamarin when it gave me a lot of choices at installation time, now I want to install c++ also in existing vs2017. How can I do that? I don't want to install the whole visual studio again.
1.Go to Control panel
2.In the Add or Remove Programs dialog box, select the product you want to repair and then click Change/Remove
3.In the Setup wizard, click Next
4.Click Repair
5.Then Modify it by selecting C++ to add it.
Note : This work in Window OS only
Alternative answer (less searching needed) : Visual Studio 2017 also adds the " Visual Studio Installer" directly to the Windows Start Menu (this is the same executable used by #John Joe's answer).
When I installed vs2017, I did select Windows development with C++ option. After installation, however, I don't see the MFC has been added. Sure enough, I get errors when I compile my application,
fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory
I cannot find the Change/Modify option with my vs2017 installation in Control Panel. How can I add "Microsoft Foundation Classes for C++" package?
If you look near the top of the VS Installer window, you'll see Workloads, Individual Components and Language Packs.
At least as far as I can see, none of the "Workloads" will include MFC in your installation. To get it, you first have to click on "Individual Components", then scroll quite a ways down to get to the "SDKs, libraries and frameworks" section. In there, you'll find a list of components for ATL and MFC support:
In the VS 2019 installer, the list of possibilities has gotten even longer. There are versions for ARM, ARM64, and x86/x64 both with and without Spectre mitigations, for each of the 141 and 142 build sets:
That's not necessarily the end of the story though: by default, even when you install that, it only installs the version Unicode build of MFC. If you want the narrow-character version, you have to install that separately. I don't think there's any entry in the installer to do this at all--but if you try to build a project that uses narrow-character MFC, you'll get an error message that includes a link to download it.
In Windows 10 with Visual Studio 2017 Community Edition to modify the Visual Studio 2017 installation, I had to go into Settings from the Windows Start menu then in the search box enter "Apps & Features" to bring up the list of installed applications (just typing in "apps" was enough to bring it up in the list).
I then looked for Microsoft Visual Studio 2017 in the list of apps, clicked on that entry which then displayed the Modify button. Clicking on the Modify button will bring up the installer to allow you to modify the various components.
I have seen cases where the installer wants to do an Update of Visual Studio 2017 before allowing you to do the Modify action. Depends on the last time you used it and the last time you did an update.
So instead of a Modify button there may instead be an Update button.
Note: see also How to install (v142) Build tools in Visual studio which describes issues seen with install order when installing both VS 2017 and VS 2019.
The VS 2017 Modify dialog has three tabs, "Workloads", "Individual components", and "Language packs". Click on the "Individual components" then scroll down to the section titled "SDKs, libraries, and frameworks" which is the last section in my install. There should be an entry for "MFC and ATL support (x86 and x64)" with a checkbox near the end.
There is a lot of stuff available from this "Individual components" view of the "Modify installation" dialog.
Just to add a tip for VS 2019:
#Jerry Coffin's answer does a good job of laying out the explosion of MFC/ATL options in VS 2019. Since there are many options and each MFC pack is 1.1+GB, here is how to pick the right one.
Platform: Hopefully you know this :) but it is in project properties.
Version: For an existing project, it is found in the project properties under "Configuration Properties -> General -> Platform Toolset"
Below is a screenshot showing both (Win32=x86 in this case). In this case I needed "C++ MFC for v141 build tools (x86 & x64)":
You should use Visual Studio Installer to make changes.
To create an MFC project, you just need to select Win32 project/Win32 Console Application for your application type, and then click OK. In Application Wizard, click next, in Application Settings, check MFC under Add common header files for:.
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.
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.