Quote:
|
Originally Posted by katkana
I'm in the process of writing an autonomous code for our 'bot, but when I tried to compile, I was hit with a syntax error in the file I'd edited the auto code into. Common problem, yes, but the line reference was one of the original code lines. (I should also note that the ONLY editing I've done to the file was to add the autonomous code... no changes were made to any other line).
Here's the error message:
Code:
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8520 "user_routines_fast_edit.c" -fo="user_routines_fast_edit.o" /i"C:\mcc18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
X:\USFirst-Klaube\C Programming\FrcCode\user_routines_fast_edit.c:111:Error: syntax error
And the line reference:
Code:
while (autonomous_mode) /* DO NOT CHANGE! */
... I also compiled the code without a space between while and (, but the same message popped up. Am I missing something here?
While I'm at it, I might as well add a question: some of the files in the output window popped up as 'out of date'.
PHP Code:
Make: The target "X:\USFirst-Klaube\C Programming\FrcCode\user_routines_fast_edit.o" is out of date.
Is this something I need be concerned with?
Thanks for the help in advance...
~kat
|
The .o file that the linker is reporting as 'out of date' is not really a problem. It has to do with the IDE not cleaning up old .o files. I wouldn't delete the .o file it is talking about, though. Did you recently add or remove a 'user_routines_fast_edit.c' source file? This shouldn't be happening. However, it is nothing to be concerned about if your code is still compiling successfully and running okay.
As for your other problem, look for a { that hasn't been closed with a }, look for " that haven't been closed, or anything else. C compilers 'cascade down' if you forget to close a block, and it will give errors for unrelated lines if the problem was above it. I don't think I was very clear:
If your code has an
if (foo==bar) {
and there isn't a
}
somewhere, that could be causing the problem. Oh, and look for lines without a ; at the end, they can do the same thing.
Good luck.