Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the "real" error?

I am having an enormous amount of errors showing up in the error list of the program, but none of the ones listed seem to be "real" errors. Some of the lines are red and then when I go to highlight over them the error disappears. I just can't seem to find where my error really is. What is the best process to go through to find my mistake?

Below is the error list in case that is helpful.

    Error   38  error C1004: unexpected end-of-file found   85
Error   68  error C1004: unexpected end-of-file found   42
Error   63  error C1903: unable to recover from previous error(s); stopping    compilation  72
Error   66  error C2059: syntax error : ')' 42
Error   2   error C2059: syntax error : '>' 80
Error   40  error C2059: syntax error : '>' 80
Error   65  error C2059: syntax error : '>' 42
Error   20  error C2065: '_Ptr_cerr' : undeclared identifier    27
Error   16  error C2065: '_Ptr_cin' : undeclared identifier 25
Error   22  error C2065: '_Ptr_clog' : undeclared identifier    28
Error   18  error C2065: '_Ptr_cout' : undeclared identifier    26
Error   28  error C2065: '_Ptr_wcerr' : undeclared identifier   32
Error   24  error C2065: '_Ptr_wcin' : undeclared identifier    30
Error   30  error C2065: '_Ptr_wclog' : undeclared identifier   33
Error   26  error C2065: '_Ptr_wcout' : undeclared identifier   31
Error   4   error C2065: 'faction' : undeclared identifier  84
Error   42  error C2065: 'faction' : undeclared identifier  84
Error   64  error C2065: 'Faction' : undeclared identifier  42
Error   13  error C2065: 'socialite' : undeclared identifier    100
Error   51  error C2065: 'socialite' : undeclared identifier    100
Error   1   error C2065: 'Socialite' : undeclared identifier    80
Error   12  error C2065: 'Socialite' : undeclared identifier    100
Error   39  error C2065: 'Socialite' : undeclared identifier    80
Error   50  error C2065: 'Socialite' : undeclared identifier    100
Error   8   error C2065: 'textWriter' : undeclared identifier   82
Error   46  error C2065: 'textWriter' : undeclared identifier   82
Error   6   error C2143: syntax error : missing ',' before ')'  84
Error   10  error C2143: syntax error : missing ',' before ')'  82
Error   14  error C2143: syntax error : missing ',' before ')'  100
Error   44  error C2143: syntax error : missing ',' before ')'  84
Error   48  error C2143: syntax error : missing ',' before ')'  82
Error   52  error C2143: syntax error : missing ',' before ')'  100
Error   17  error C2143: syntax error : missing ',' before ';'  25
Error   19  error C2143: syntax error : missing ',' before ';'  26
Error   21  error C2143: syntax error : missing ',' before ';'  27
Error   23  error C2143: syntax error : missing ',' before ';'  28
Error   25  error C2143: syntax error : missing ',' before ';'  30
Error   27  error C2143: syntax error : missing ',' before ';'  31
Error   29  error C2143: syntax error : missing ',' before ';'  32
Error   31  error C2143: syntax error : missing ',' before ';'  33
Error   7   error C2143: syntax error : missing ';' before '{'  32
Error   15  error C2143: syntax error : missing ';' before '{'  10
Error   32  error C2143: syntax error : missing ';' before '{'  36
Error   35  error C2143: syntax error : missing ';' before '{'  27
Error   45  error C2143: syntax error : missing ';' before '{'  32
Error   54  error C2143: syntax error : missing ';' before '{'  34
Error   57  error C2143: syntax error : missing ';' before '{'  48
Error   60  error C2143: syntax error : missing ';' before '{'  61
Error   3   error C2143: syntax error : missing ';' before '}'  82
Error   11  error C2143: syntax error : missing ';' before '}'  98
Error   33  error C2143: syntax error : missing ';' before '}'  42
Error   34  error C2143: syntax error : missing ';' before '}'  45
Error   36  error C2143: syntax error : missing ';' before '}'  83
Error   37  error C2143: syntax error : missing ';' before '}'  85
Error   41  error C2143: syntax error : missing ';' before '}'  82
Error   49  error C2143: syntax error : missing ';' before '}'  98
Error   55  error C2143: syntax error : missing ';' before '}'  43
Error   58  error C2143: syntax error : missing ';' before '}'  57
Error   61  error C2143: syntax error : missing ';' before '}'  69
Error   67  error C2143: syntax error : missing ';' before '}'  42
Error   5   error C2275: 'Faction' : illegal use of this type as an expression  84
Error   43  error C2275: 'Faction' : illegal use of this type as an expression  84
Error   9   error C2275: 'std::ofstream' : illegal use of this type as an expression    82
Error   47  error C2275: 'std::ofstream' : illegal use of this type as an expression    82
Error   53  error C2653: 'Socialite' : is not a class or namespace name 33
Error   56  error C2653: 'Socialite' : is not a class or namespace name 46
Error   59  error C2653: 'Socialite' : is not a class or namespace name 60
Error   62  error C2653: 'Socialite' : is not a class or namespace name 72
like image 242
Redwards Avatar asked Mar 24 '23 17:03

Redwards


2 Answers

Probably a missing ; after the closing } of a class / struct. Could you post some code?

UPDATE: The code compiles now on my gcc. The problem I found is that you have a circular dependency between your classes. So solve this, forward declare some of them in the headers. I added class Faction; before class Socialite in Socialite.h and class Socialite; before class Faction in Faction.h.

like image 180
tomato Avatar answered Mar 26 '23 08:03

tomato


Unexpected end of file is usually that you are missing a closing "something", such as a bracket } or parenthesis )

like image 28
Eric Avatar answered Mar 26 '23 07:03

Eric