Download

Why does visual studio mark a line with a red underline as if it was an error if it is not?


The code compiles and it it happens.

Does the error window have any entries?
I have found VS doing this from time to time, It is probably due to intelisense not having a definition for it yet or some such thing.

HTH

Its IntelliSense which is sometimes not fully up to date. IntelliSense is the mechanic which provides you with information like parameter info, fields/methods availability on objects(when pressing . or -> ).

Somehow its seems very hard voor Microsoft to get IntelliSense working good for C++. With C# I never have issues like you describe, with C++ I do.

Dont worry about it, even though its annoying when programming…

Alright thanks :slight_smile:

Change build configuration, compile, change back – quite often seems to get IntelliSense back on track (eg, if you were compiling Development Editor, change to Development Client, compile, then back…)

False errors often happen when editing top of the .h file, or when VS doesn’t know that it does, in fact, have access to relevant header file.

Tried that, didn’t help :\ Thanks though.

It is intellisense’s doing. Intellisense is very, very dumb. It is also has audacity to put warnings like that into error windows.

Just disable error squiggles, they’re almost never helpful.

Tools->Options->C+±>Advanced, set “Disable Squiggles” to “true”.

But that way I miss other relevant errors :
Btw after working for about half a day on the project all of a sudden intellisense recognized everything and stopped giving me those errors :slight_smile: