Check the file the was compiled just before it, or more likely the last file
#include'd in the the file where the error appears. Look for missing
}s. The compiler is weird that way, although possibly technically right, as the faulty syntax isn't until something unexpected happens, like when you try and start one function definition inside another one.
Another way to isolate invisible errors inside a file is to put known-good code before and after the line with the error, eg.
Code:
int someFunction(void) {
int i;
int j;
i = j /4; //this line is for some reason producing an error
return i;
}
So do this:
Code:
int someFunction(void) {
int i;
int j;
printf("hello");
i = j /4; //this line is for some reason producing an error
printf("everyone");
return i;
}
And see if the compiler still says its on the same line, or if it is now stopping on the upper or lower printf(). If so, then you know your error is on either side of the statement you were looking at, so check for the usual missing
; or
}.
Good luck,
Robinson