Using Visual Studio 2013 C++, I got compilation errors that I couldn’t explain.
Â
The compilation errors were:
Â
[*]*main.cpp(325): error C2601: ‘FLAG’ : local function definitions are illegal
Â
[*]main.cpp(323): this line contains a ‘{‘ which has not yet been matched
Â
[*]main.cpp(326): fatal error C1075: end of file found before the left brace ‘{‘ at ‘main.cpp(323)’ was matched*
Â
But there was nothing wrong with my code. I counted all brackets and the number matched. There weren’t any function inside another function.
Â
I solved it by removing all "//" comments from the source code. It seems that the reason for that is bad line formatting which causes the compiler to miss a line break, so the line after a comment is treated as a comment as well.
Â
For example:
// This is a commentThis_is_a_line;
Â
is treated as:
Â
// This is a commentThis_is_a_line;
Â
There are many posts of the net about similar problems and some even suggested that they could be caused by a memory (RAM) fault on the machine, so before you replace your RAM, just remove the comments and see…
— Michael Haephrati