|
Re: C18 v2.4 -- Syntax error where there is no syntax error
This is a pretty common problem particular to include files.
The important clue is that the error gets flagged on the first line of some include file when the compiler finally figures out that you haven't closed a bracket somewhere previous.
The key is to remember that all your #include's are just inserting all that text into a single massive file that's then passed to the compiler, so the error is really getting flagged in the middle of that big file, not in the single include file spit out in the error message.
So thinking about it as one huge file rather than a series of includes...
What it really means is there is an error in another included file or other text before the include file that shows the error just like in regular code when it's often the line or block of code before.
If the error occurs in your very first include then the cause is often accidental characters typed at the very top of your source file or an unclosed comment field.
P.S.
Nice search skills by the way to rediscover this thread among thousands.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Last edited by Mark McLeod : 12-01-2007 at 09:49.
|