|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: hey, stupid question but...
thanks for the quick response! I just tried prototyping it, but no luck. The exact error i'm getting looks like this
Code:
Clean: Deleting intermediary and output files. Clean: Deleted file "C:\Documents and Settings\Mounds View Schools\My Documents\FrcCode_2007_8722\main.o". Clean: Deleted file "C:\Documents and Settings\Mounds View Schools\My Documents\FrcCode_2007_8722\user_routines_fast.o". Clean: Deleted file "C:\Documents and Settings\Mounds View Schools\My Documents\FrcCode_2007_8722\user_SerialDrv.o". Clean: Deleted file "C:\Documents and Settings\Mounds View Schools\My Documents\FrcCode_2007_8722\ifi_startup.o". Clean: Deleted file "C:\Documents and Settings\Mounds View Schools\My Documents\FrcCode_2007_8722\ifi_utilities.o". Clean: Done. Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "main.c" -fo="main.o" /i"C:\mcc18\h" -D_FRC_BOARD -D_LARGE_CODE -D_DONT_USE_TMR0 -mL -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "user_routines_fast.c" -fo="user_routines_fast.o" /i"C:\mcc18\h" -D_FRC_BOARD -D_LARGE_CODE -D_DONT_USE_TMR0 -mL -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "user_SerialDrv.c" -fo="user_SerialDrv.o" /i"C:\mcc18\h" -D_FRC_BOARD -D_LARGE_CODE -D_DONT_USE_TMR0 -mL -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "ifi_startup.c" -fo="ifi_startup.o" /i"C:\mcc18\h" -D_FRC_BOARD -D_LARGE_CODE -D_DONT_USE_TMR0 -mL -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "ifi_utilities.c" -fo="ifi_utilities.o" /i"C:\mcc18\h" -D_FRC_BOARD -D_LARGE_CODE -D_DONT_USE_TMR0 -mL -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "user_routines.c" -fo="user_routines.o" /i"C:\mcc18\h" -D_FRC_BOARD -D_LARGE_CODE -D_DONT_USE_TMR0 -mL -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- C:\Documents and Settings\Mounds View Schools\My Documents\FrcCode_2007_8722\user_routines.c:228:Error: syntax error Halting build on first failure as requested. BUILD FAILED: Sat Jan 20 12:21:21 2007 |
|
#2
|
|||||
|
|||||
|
Re: hey, stupid question but...
Quote:
Have you declared any globals x or y already? Last edited by Adam Richards : 20-01-2007 at 13:25. |
|
#3
|
|||
|
|||
|
Re: hey, stupid question but...
I don't want to post the entire code (our homebrew mecanum drive code) but at the top of the post where I comment by the bracket is line 228. thanks for your help
![]() |
|
#4
|
|||||
|
|||||
|
Re: hey, stupid question but...
Since I can't see the whole code, and I won't know what functions might already be predefined, have you tried renaming the function to something other than intMax? Try just qwerty or something miscellaneous for now to see if the function might already have been reserved for something.
|
|
#5
|
||||
|
||||
|
Re: hey, stupid question but...
Check around in your code. It is likely that the syntax error is actually entirely unrelated to that section of the code. Looks like you might have a missing brace or semicolon somewhere.
|
|
#6
|
|||||
|
|||||
|
Re: hey, stupid question but...
Thank you for calling the Department of Redundancy Agency.
Have you checked for a missing semicolon or closing brace? ![]() |
|
#7
|
||||
|
||||
|
Re: hey, stupid question but...
This may or may not be way off, but I remember reading somewhere that the C18 compiler has trouble with filenames longer than 64 characters. It wouldn't compile some code that I had in the My Documents folder once, so I put all the code in a folder in the root c: directory. Worked fine after that.
Just something I remember, may or may not help you! Hope you get it figured out. Best of luck, -Chris |
|
#8
|
||||
|
||||
|
Re: hey, stupid question but...
Quote:
|
|
#9
|
||||
|
||||
|
Re: hey, stupid question but...
i could be wrong...
but you declared the integer variable "max" in the function. try putting "int max;" in your first line of code along with all your other variable declarations and then in the function... "max = ..." |
|
#10
|
||||
|
||||
|
Re: hey, stupid question but...
All that would do is make it global, and the error would be different for that. I'm with Mike and the gang, I say it's an error in a previous line, or it doesn't like using int in the function name.
|
|
#11
|
||||
|
||||
|
Re: hey, stupid question but...
Quote:
but ive made the mistake of using function-level variable outside the function. Its probably not the problem, but its worth a try. |
|
#12
|
|||||
|
|||||
|
Re: hey, stupid question but...
it probably isn't prototyping since it is a syntax error. My guess is that it sometimes tells you there's an error a line or two after the actual error. It may be a problem with the int intmax(int x, int y) line. try changing a couple things to see if that's the problem.
|
|
#13
|
||||
|
||||
|
Re: hey, stupid question but...
Hey you who had the problem, are you still with us?
Why do you even have 'max'? Couldnt you just use this? Code:
int intMax(int x, int y)
{ //here is where I get the syntax error
if(y > x)
x = y;
return x;
}
|
|
#14
|
|||||
|
|||||
|
Re: hey, stupid question but...
Look closely at the lines preceding the one identified as causing the error. I'm guessing you have a missing semicolon or close brace somewhere before your intMax function definition.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Stupid Variable question.... | BillyJ | Programming | 3 | 20-02-2006 19:49 |
| Stupid question but... | Adam Y. | Math and Science | 6 | 16-02-2004 19:29 |
| Really stupid question | psychoCHIPMUNKK | Kit & Additional Hardware | 3 | 15-02-2004 00:26 |
| stupid question x10 | Tom Bottiglieri | CD Forum Support | 1 | 04-02-2004 22:40 |
| ill probably feel stupid but i do anyway so... | Anthony Kesich | Programming | 8 | 05-11-2003 12:53 |