How to enable IntelliSense for C++ in Visual Studio 2015 - c++

I've just installed VS2015 for C++ development, however traditional hot keys like ctrl+space or . or -> don't show the IntelliSense window.
Somewhere on the web I found that I needed to open the IntelliSense Manager from the Tools menu. But that's not in my Tools window.
In addition, I reviewed related items in my IDE settings and found a Text Editor -> C++ -> Advanced - IntelliSense section with a number of settings, including Disable IntelliSense, which is True in my setup. The problem is that all settings in this section are readonly (not editable).
How do I fix the problem?
VS2015.2, fresh install. No previous installation on this host.

Related

"Manage Client-Side Libraries" menu not appearing

I'm trying to use the new Library Manager (LibMan) feature in Visual Studio 2017 (I'm using Version 15.7.1) but it is not appearing on either the project context menu or the Project menu.
I have tried various web projects but I can't see it for any of them. The only project type I haven't tried is ASP.NET Core 2.1 (I don't have the preview installed) but I can't find any docs that say it only works with ASP.NET Core 2.1
Here is a screenshot to prove it's not there:
had the same issue. I found the answer two it on another site, but for the life of me cannot find it for reference right now. The easiest thing to do is to build it yourself and install it. Works perfectly fine, I did it and now have the Manage Client Side libraries showing up.
Clone / download the Library Manager from GitHub. (https://github.com/aspnet/LibraryManager/)
Build it in Visual Studio 2017
Run the .Vsix installer
Begin to use the Manage Client Side Libraries from the context menu or project menu.
Hope this helps.
For me, in VS 2022 the context menu option appears but the dialog doesn't show. I found out that instead of right-clicking on project item i have to right-click on wwwroot item and then the dialog is shown
Even though Visual Studio Community 15.7.5 references the "Library Manager" it looks like it is still in Preview and to be released with VS 15.8.
If you would like to use the Library Manager now it is fairly easy but there are a few work arounds right now to get it to install, probably a reason it is still in Preview.
Clone or Download the source code
Note: This requires the Visual Studio extension development Workload to be installed (Tools -> Get Tools and Features under "Other Toolsets").
According to this issue on GitHub it will not install, before compiling the Extension open the project file for the LibraryManager.Vsix project
[LibraryManagerDir]\src\LibraryManager.Vsix\Microsoft.Web.LibraryManager.Vsix.csproj
and update (line #30)
<IsProductComponent>false</IsProductComponent>
After 15.8 comes out this needs to be reset back to true to be able to install it.
Open the LibraryManager.sln and make sure to change the Configuration to Release and Build the Solution.
This will create a .vsix install file:
[LibraryManagerDir]\src\LibraryManager.Vsix\bin\Release\Microsoft.Web.LibraryManager.vsix
Open Microsoft.Web.LibraryManager.vsix to launch the Visual Studio Installer.
Then you will have the Add->Client Side Library in your Context Menu.

Win32 Console Application missing in VS2017. How to create C++ Empty Project?

I installed the VS2017 community and I am lost: the Win32 Console Application in missing.
I don't even have template when I go to New Project and also I cannot create C++ Empty Project in VS2017.
How I can solve it?
Install all the optional tools for c++ development
then follow these steps ( Microsoft has updated its visual studio and there are some minor changes)
The new updated changed some things. Win32 Console Application is gone in the new update. Go to File -> New Project -> Visual C++ -> Windows Desktop -> Windows Desktop Wizard -> Application type: Console Application (.exe), Additional Options: Empty Project
Then have fun!
You just need to install "Visual Studio C++ core features". Don't install everything about C++. It consumes too much storage and possibly slow down your IDE.
Steps:
Open Visual Studio 2017 Installer.
Select "Individual Components" tab.
Select "Visual Studio C++ core features".
That's all.
If you are not interested in Game or Mobile C++ development you can remove your selections in "Workloads" tab to get free space in your hard drive :)

MFC development in vs2017

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:.

cannot open source file "afxwin.h"/"afxext.h"/"afxdisp.h"/"afxdtctl.h"/"afxcmn.h"/afxdisp.h etc

I try to ran a previous written MFC c++ code on my visual studio 2015 MFC with multitype MFC library installed.
However, I still have 12 errors here regarding missing function:
IntelliSense: cannot open source file "afxwin.h"
C1083 Cannot open include file: 'afxwin.h': No such file or directory
cannot open source file "afxext.h"/"afxdisp.h"/"afxdtctl.h"/"afxcmn.h"/afxdisp.h etc....
Where can I get these head files?
Again, my set up is:
VIsual studio 2015 ultimate MFC
Multibyte MFC library installed
Windows 8 - 64 bit machine
Thanks!
I just fixed a similar problem. Here's how you can resolve this.
Go to your control panel
Navigate to uninstall/change a program.
Scroll down until you see your visual studio installation
Click change
Once the window pops up, click "Modify"
Under Programming Languages -> Visual C++
Make sure "Microsoft Foundation Classes for C++" is checked. If it isn't select it and click update.
For VS2019 the above solutions didn't worked for me.
I had to go to "Installer -> Individual Components -> "
and install the following to solve the issue:
"MSVC v141 – VS 2017 C++ x64/x86 build tools (v14.16)"
"C++ MFC for v141 build tools (x86 & x64)"
"C++ ATL for v141 build tools (x86 & x64)"
For what it's worth. I was getting similar errors after a fresh installation of VS2017. I installed the C++ features from the main installer and created a new project with MFC checked. I assumed "Microsoft Foundation Classes for C++" was installed by this point, but I kept getting these errors. Furthermore, after saving and closing the solution for the first time, VS wouldn't load the project if I opened the solution from the recently used list because dependencies were missing.
What worked for me
I opened the solution file directly using VS2017. Finally, VS informed me that "Microsoft Foundation Classes for C++" was not installed and gave me the option to install it. I had previously looked through the installer features and could not find this option.
EDIT
Per Vladimir's comment below...
In 2017 Visual Studio Installer it ["Microsoft Foundation Classes for C++"] is under Modify / Individual Components / SDKs... / MFC and ATL support (x86 and x64)

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.