|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
MPLAB syntax problem
I've now written some drive code for our robot and I wanted to compile it to make sure it worked. I didn't have the cd that came in the kop so I downloaded the student trial of the C18 complier and installed it. When I tried to compile my code I got this error.
Make: The target "C:\Documents and Settings\David Pick\Robotics\frc_camera_21\camera.o" is up to date. Make: The target "C:\Documents and Settings\David Pick\Robotics\frc_camera_21\camera_menu.o" is up to date. Make: The target "C:\Documents and Settings\David Pick\Robotics\frc_camera_21\eeprom.o" is up to date. Make: The target "C:\Documents and Settings\David Pick\Robotics\frc_camera_21\ifi_startup.o" is up to date. Make: The target "C:\Documents and Settings\David Pick\Robotics\frc_camera_21\ifi_utilities.o" is up to date. Make: The target "C:\Documents and Settings\David Pick\Robotics\frc_camera_21\main.o" is up to date. Make: The target "C:\Documents and Settings\David Pick\Robotics\frc_camera_21\serial_ports.o" is up to date. Make: The target "C:\Documents and Settings\David Pick\Robotics\frc_camera_21\terminal.o" is up to date. Make: The target "C:\Documents and Settings\David Pick\Robotics\frc_camera_21\tracking.o" is up to date. Make: The target "C:\Documents and Settings\David Pick\Robotics\frc_camera_21\tracking_menu.o" is up to date. Make: The target "C:\Documents and Settings\David Pick\Robotics\frc_camera_21\user_routines.o" is out of date. Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "user_routines.c" -fo="user_routines.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD MPLAB C18 v3.02 (demo) Copyright 1999-2005 Microchip Technology Inc. Days remaining until demo becomes feature limited: 59 C:\Documents and Settings\David Pick\Robotics\frc_camera_21\user_routines.c:367:Er ror: syntax error Halting build on first failure as requested. BUILD FAILED: Mon Jan 22 20:53:36 2007 Except the only code on line 367 is: char target; Which also happens to be the first line of code I wrote. Anybody know whats going on? Thanks. |
|
#2
|
||||||
|
||||||
|
Re: MPLAB syntax problem
You'll have to post more code before and after that, preferably the entire function.
One possibility is that you are declaring variables in the middle of the function, which is legal in C++ but not in C. Also, The C18 compiler version 3.x won't work with the existing libraries. You must use the version 2.4 that came in the kit. That probably isn't causing the syntax error, but will keep you from successfully compiling farther down the road. |
|
#3
|
|||
|
|||
|
Re: MPLAB syntax problem
It's a bad term for the error, but MPLAB will call any variable declaration, not at the beginning of the routine, a syntax error. If that's not it, check all your preprocessor directives. There may be something put in by the preprocessor that's causing the error, or perhaps the term target is #defined as something already.
|
|
#4
|
||||
|
||||
|
Re: MPLAB syntax problem
Moving the variable declarations got rid of the errors. Thanks for the tip. The only problem is now I get a different error.
MPLINK 4.02, Linker Copyright (c) 2006 Microchip Technology Inc. Error - Coff file format for 'ifi_library.o' is out of date. Error - Could not build member 'ifi_library.o' in library file 'C:\Documents and Settings\David Pick\Robotics\frc_camera_21\FRC_alltimers_8722.lib '. Errors : 2 BUILD FAILED: Mon Jan 22 23:12:57 2007 I think I remember seeing another thread about an error like this so I'm gonna search for it. Thanks for your help. [edit]Found the problem in another thread, thanks for your help [/edit] Last edited by dpick1055 : 23-01-2007 at 00:18. |
|
#5
|
|||
|
|||
|
Re: MPLAB syntax problem
You need to use the C suite from the KOPs. There are incompatibilities between the suite provided in the KOP which is an older version of compiler/linker and the current versions from Microchip's website.
|
|
#6
|
|||
|
|||
|
Re: MPLAB syntax problem
Quote:
|
|
#7
|
||||
|
||||
|
Re: MPLAB syntax problem
Thanks, that got rid of the error.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with MPLAB | dpick1055 | Programming | 5 | 21-01-2007 00:34 |
| MPLAB C18 problem | Justyn | Programming | 0 | 09-03-2005 11:37 |
| MPLAB IDE Problem | amateurrobotguy | Programming | 10 | 26-02-2005 09:29 |
| Problem with MPLAB | d.courtney | Programming | 5 | 02-02-2005 21:42 |