![]() |
Syntax Problems...
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-Code:
while (autonomous_mode) /* DO NOT CHANGE! */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:
Thanks for the help in advance... ~kat |
Re: Syntax Problems...
Quote:
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. |
Re: Syntax Problems...
The out-of-date message shouldn't be anything that you manually have to fix. The compiler program should update the files itself, so just ignore those messages. If the compiler doesn't do it itself, however, I have no idea what to do.
|
Re: Syntax Problems...
Quote:
~kat |
Re: Syntax Problems...
Quote:
|
Re: Syntax Problems...
Quote:
As Bharat said, we can't tell you for sure unless you post the entire file. |
Re: Syntax Problems...
I'll post the entire file.. but there's a new problem. I'm not sure anymore what to call a "line" of code, seeing as a friend of mine pointed out to me that, when counting code lines, I should ignore the comments, just as the compiler does. So I went back to count comment lines, and lo and behold... there weren't enough lines (the way I counted them) to justify a 'line 111'. *hangs head in shame* and now we see the depth of her ignorance. *sigh* anywho. If anyone could clarify just what constitutes a line of code, it'd be much appreciated.
So... onto business. Here's the entire code: Code:
/******************************************************************************* |
Re: Syntax Problems...
The compiler actually says the physical line number, so the one with 111 next to it in MPLAB is the one that the compiler is complaining about. Most compilers are like this, although a few aren't, which is probably where your friend got confused. :)
I'm at school right now, so I'm too busy to look at the code... when I get home. :) |
Re: Syntax Problems...
Quote:
if(end_program != 1) /* if program has not ended */ |
Re: Syntax Problems...
Quote:
Code:
Error - section 'InterruptVectorLow' type is non-overlay and absolute but occurs in more than one input file.I'm a little confused as to what this error message means, and how can I fix it? |
Re: Syntax Problems...
Quote:
|
Re: Syntax Problems...
Quote:
Code:
else if(counter > 120 && counter < 240) /* if 2-4 seconds have passed */-Kevin |
Re: Syntax Problems...
Quote:
I would prefer to fix this by doing something less error-prone like this: Code:
if(counter < 121) /* if less than 2 seconds have passed */Quote:
|
Re: Syntax Problems...
Awesome-ness. Thank you all so much for the help!
Until next problem... ;) ~kat |
| All times are GMT -5. The time now is 20:08. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi