How to get IntelliSense to reliably work in Visual Studio 2008
Solution 1
I've also realized than Intellisense is sometime 'lost', on some big project. Why? No idea.
This is why we have bought Visual Assist (from Tomato software) and disabled Intellisense by deleting the dll feacp.dll in the Visual studio subdirectory (C:\Program Files\Microsoft Visual Studio 8\VC\vcpackages)
This is not a solution, just a workaround.
Solution 2
Native C++ intellisense does not work reliably in any version of Visual Studio. I find there are two common problems:
1) Header file paths are not set-up correctly. When you find a type where intellisense is not working, use the IDE to click through each header file to find the one containing the type. (Right click on #include and select Open Document...). If this fails before you get to the file which declares the type then this is your problem. Make sure header file search paths are set-up correctly.
And,
2) The intellisense database is corrupt. This happens ALL The time. You need to close the solution, delete the .ncb file, and then reopen the solution. I posted the macro I use for this in answer to another question here.
The preprocessor can also confuse intellisense - so make sure any #defines during build are also available to intellisense. Other than that, I don't know what else can break it. I've not seen any particular issues with forward declarations.
Solution 3
It looks like there's hope on the horizon for those of us unable to obtain Visual Assist:
Solution 4
Do you have any add-ins installed (or uninstalled)? I find that effects my intellisense.
Besides that just making sure your Tools->Options->Text Editor->All Languages "Auto List Members" and "Parameter Information" are checked off.
Solution 5
My fix to itellisense was required after that awful refactor utility minced my code. The problem was a class header file that included an #include of itself. The recursive reference destroys itellisense. A symptom of this is if itellisense can see other classes but not the current one. Also:
Use #pragma once to eliminate duplicate header loads
If the project now takes a very much longer time to load, that itellisense trying to make sense of the conflict that is causing then lack of completion support.
Often it is only one class object that is affected, This shows you what files (usually headers) to look at.
Adam McKee
Updated on April 30, 2020Comments
-
Adam McKee about 4 years
Does anyone know how to get IntelliSense to work reliably when working in C/C++ projects? It seems to work for about 1 in 10 files. Visual Studio 2005 seems to be a lot better than 2008.
Edit: Whilst not necessarily a solution, the work-around provided here:
How to get IntelliSense to reliably work in Visual Studio 2008
Is probably the best bet if I want a decent IntelliSense system.
-
demoncodemonkey almost 15 yearsBut no support for C++/CLI in the first release of VS2010 :/
-
A.A over 14 yearsThats a helpful solution to delete the ncb file. :)
-
Michel over 14 yearsThanks, this helped me figure out why Intellisense mysteriously stopped working!
-
Stormenet over 13 years+1 for how to disable the intellisense. The macro's I used for disabling in 2005 didn't work anymore in 2008.
-
Billy ONeal over 13 yearsNote: Intellisense was fixed in VS2010.
-
SvenS about 12 yearsI read elsewhere that just deleting that dll should be handled carefully, creating a folder named "Solutionname.ncb" should be preferred. Results in annyoing error messages at every startup though. And +1 for mentioning VAX.
-
Benj about 12 yearsThis is still good advice as of VS2010 since intellisense in VS2010 is very slow (although now it's possible to disable intellisense using the config page in VS)
-
Tom Bushell about 12 yearsMy "All Languages" settings showed green squares instead of checkmarks (presumably because they were set for only some of the languages). Clicking on them so they were checked fixed the problem for me.
-
c00000fd over 10 yearsDamn it, Microsoft! I have 544 #includes in this project (not counting the nested #includes in them and countless #defines.) Fix your s&^*! Thanks to the poster for the idea.
-
John over 10 years+1 deleting the sdf (VS2010's new extension for what what was ncb in '08) worked for me. I closed the VS solution, deleted the solution's SDF file, re-opened the solution, re-built the solution, and voila.