Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellisense in vs2010 with c++

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.

like image 738
Baruch Avatar asked Mar 02 '11 19:03

Baruch


3 Answers

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.

like image 183
Baruch Avatar answered Oct 19 '22 22:10

Baruch


Look at this question :C++ VS Express 2010 Intellisense

It was solved by pressing CTRL+J .

EDIT: maybe it's the stdafx.h problem !

Add a file stdafx.cpp and a file stdafx.h to the project ! Use #include "stdafx.h" as yhe first line of code in all your .cpp files. Include all rarely/never changing and frequently used header-files in stdafx.h. Turn on precompiler-headers in your project and rebuild the project.

(Create a dummy project which have precompiled headers on to see how it's been done)

like image 31
engf-010 Avatar answered Oct 19 '22 22:10

engf-010


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

like image 20
asdf Avatar answered Oct 20 '22 00:10

asdf