1

I have a visual studio 2012 project. All of the paths are set correctly, and I can compile the project without any problem.

While using the Visual Studio IDE, I click on a function or class defined in a header, which is not in the root of source directory, and the IDE can not find it. When I select a header file and ask the IDE to open it, the IDE says that it can not find it.

What is the problem and how can I fix it?

I tried to reset IntelliSense cache, but there is no refresh menu on edit -> IntelliSense.#

splrs
  • 2,424
  • 2
  • 19
  • 29
mans
  • 17,104
  • 45
  • 172
  • 321
  • The IDE looks for things in the solution, the compiler looks for things in the include paths. – molbdnilo Jan 07 '15 at 15:57
  • Any chance you have the intellisense database switched off (Tools > Options > Text Editor > C/C++ > Advanced > Intellisense > Disable IntelliSense)? This does for some reason prevent the "Open document" command from working on #include statements, and it would of course explain why "find symbol" type commands would fail too. – dlf Jan 07 '15 at 16:26
  • 1
    When you say "All of the paths are set correctly," are you referring to the paths in Project Properties | Configuration Properties | VC++ Directories? There are other ways to affect the paths, but this one is the one the IDE seems to understand. Are you using absolute paths there? – Adrian McCarthy Jan 07 '15 at 16:47
  • @AdrianMcCarthy By "all of the paths are set correctly" I mean that the compiler can understand it. Today I noted that when I close IDE and also turn off my pc, the next time that I open project, it finds all files correctly, but after some times it looses data and then I reports it can not find files! – mans Jan 08 '15 at 22:13
  • @AdrianMcCarthy If you'll make that into an answer and ping me, you'll have my upvote. I was having this same problem and adding the paths there (even though they were already included somewhere else that was allowing the compiler to see them) made intellisense happy. – reirab Aug 23 '17 at 16:52

0 Answers0