Intellisense in vs2010 with c++

2019-02-17 15:56发布

I can't get intellisense to work. Even if I start with an empty project and add just one file to it with only an include for iostream and an int main() function that prints a char with cout (basically the most basic program), if I try to get intellisense to show anything (say by typing cout.) I get

IntelliSense: 'No additional information available' (See 'Troubleshooting IntelliSense in C++ Projects' for further help.)

Hours of googling have yielded a couple of articles over at the Microsoft sites that suggest a bunch of things to try or reasons why it wouldn't work. I have tried and eliminated them all, except for one that mentions that stdafx.h has to be in the path.

What is this file?
How do I know if it is in the path if I don't know where it is?
What does it have to do with IntelliSense?
Should I add this file to my project to get it to work?

Thank you.

12条回答
相关推荐>>
2楼-- · 2019-02-17 16:35

Do you use the /UseEnv switch when opening visual studio? It breaks Intellisense for c++ projects.

查看更多
相关推荐>>
3楼-- · 2019-02-17 16:35

Maybe it never got installed, have you tried a repair install?, it's worth a shot..

查看更多
Summer. ? 凉城
4楼-- · 2019-02-17 16:37

I got it solved by the Microsoft team at http://connect.microsoft.com/VisualStudio/feedback/details/652838/intellisense-not-creating-ipch-folder

It had to do with a certain Windows Update installed on WinXP. The solution was to install VS2010_SP1 and then a certain update over it.

查看更多
我想做一个坏孩纸
5楼-- · 2019-02-17 16:40

There are a couple of threads about similar problems: click on Help at VS2010 and look for Intellisense.

http://social.msdn.microsoft.com/Search/en-US?query=intellisense%20settings&refinement=123&beta=0&ac=1

http://social.msdn.microsoft.com/Forums/en/vswpfdesigner/thread/75c4cc8d-9a81-4bda-84f0-f619f7493b3b

stdafx.h should be added automatically when you create a New Project.

From the file:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
查看更多
Viruses.
6楼-- · 2019-02-17 16:42

Please find *.sdf file (Intellisence database cache) in project directory and delete it and relaunch project solution this will bring back your intellisence.

查看更多
冷血范
7楼-- · 2019-02-17 16:46

I know this is an old question, but I had a similar problem IntelliSense: 'No additional information available' (See 'Troubleshooting IntelliSense in C++ Projects' for further help.). My problem wasn't related with stdafx.h.

To solve my problem, I closed VS2010, deleted the .sdf and .suo files as well as the ipch directory inside the project's main folder.

Then I restarted VS2010, waited for it to build all its metadata again and Intellisense (autocompletion) worked nicely.

EDIT: I am not aware if this "maneuver" has negative side effects.

查看更多
登录 后发表回答