Start with the first error recorded. This is often the cause of many subsequent problems because the first error causes the parser to not synchronize with the rest of the code.
In C ++, long cascades of errors are often caused by an undeclared type (did you forget the include file?) Or missing ; after defining a class or structure.
Consider:
Foobar fb; // Declare an instance of Foobar.
If Foobar has not yet been declared (perhaps because you forgot to include "foobar.h"), the compiler might think that you are trying to declare a variable named Foobar with the default int type. From there, he sees fb and gets confused.
Or consider:
struct Foobar { int x; int y; } int blah = 0;
Without ; after determining the structure, the analyzer considers that you are trying to declare an Foobar instance with the name int, which is unacceptable, since int is a reserved keyword. And everything after that looks like a gobbledegook for the compiler.
One trick - temporarily #if 0 - is all the code after the line with the first error reported, as this will reduce noise until you isolate the original problem.
source share