Red lines in code (in VS), but code compiles fine?

I am trying to get started with an existing project in Visual Studio.

When I view the code, I get the red squiggly lines under all the #includes, which say "can't open source file *.h" when I mouse over it.

But the header files are in the project and the project compiles fine if I build it.

Does anyone know why the IDE is complaining?

Thanks in advance.
it should clear up once it compiled. VS has a lot of bad "error" underlines lately. I ignore them and fix the ones the compiler finds.
are they C headers, eg math.h, or other standard ones with .h on them, by any chance?
Last edited on
IntelliSense (the red lines that show up, not compiler errors) keeps a cache so it isn't constantly re-parsing your files over and over again.
Sometimes this can be buggy or not update properly. I think deleting the hidden .vs folder in your solution will also delete the IntelliSense cache, so you could try that.
Thanks for the suggestions. I just removed the .vs and recompiled/built the code (which completed with no errors). However the red lines are still showing up :(

Can you think of any other solutions?
Yeah, the last couple of updates to VS 2019 has made Intellisense more than a bit twitchy.

Deleting the hidden .vs folder removes a lot of configuration settings VS keeps track of. Including if the project/solution defaults to debug or release configuration and x86 or x64. It also nukes any user-defined configuration settings.

I've found the easiest way to give Intellisense a kick in the bum is to perform a compile of a source file (CTRL +F7) when the source listing is focused.

2nd easiest is close the project/solution and reopen it.

3rd easiest is to just give VS a bit of time (10-15 seconds) to let Intellisense stop being Bevis-ish.
If the rhombus in the bottom left of the VS window before Ready displays scrolling lines, then VS is performing background processing - including intellisense. Only when the rhombus is blank have the background processing completed.
Good things to note, thanks.
Topic archived. No new replies allowed.