|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Compile failure
Hi, I'm a new programmer when it comes to FRC (I programed for FVC last year, and have some level of programming background), and I'm having trouble getting some code to compile.
The assembler works fine, but when MPLINK starts up, it fails, giving an error message of: Code:
Error - could not find definition of symbol 'STATUS' in file 'J:\*\user_routines_fast.o |
|
#2
|
|||
|
|||
|
Re: Compile failure
1. What does project->build options->project show under the General tab for include path? It should point to mcc18\h subdirectory where the pic*.h files are located. That is where STATUS is defined.
2. What does edit->find in files with find what equal to STATUS show. Note ifi_routines_fast.c includes user_routines.h so a change there may have effected the build. The file ifi_default.h should include p18cxxx.h which will include the correct header file for the processor (p18f8722.h) if the project configuration is set correctly. The 'STATUS' name is defined in the p18*.h file. Last edited by dcbrown : 05-02-2008 at 20:28. |
|
#3
|
|||
|
|||
|
Re: Compile failure
The include path was wrong, and I fixed it, but the error is still occuring. Plus, I can't find STATUS anywhere, just some references to statusflag and Device Status.
I also don't recognize some of the files you're talking about. In my program directory I have: ifi_startup.c ifi_utilities.c main.c user_routines.c user_routines_fast.c user_SerialDrv.c delays.h ifi_aliases.h ifi_default.h ifi_utilities.h user_routines.h user_SerialDrv.h the library file (722 one), and the linker file (same). Am I missing something? EDIT: I downloaded Keven's code and got the same thing in ifi_code.o. If it makes a difference, I'm running MPLAB 8.0 and C18 3.10 Last edited by darkChozo : 05-02-2008 at 22:46. Reason: Add info |
|
#4
|
|||||
|
|||||
|
Re: Compile failure
There might be some residual file references left in the project definition from when the directory paths were messed up. Try doing a full Build of the project instead of a Make (or just do a Clean first).
dcbrown is correct to point out that editing user_routines.h will affect user_routines_fast.c (because it's #included). What changes did you make? It's possible that something at the very end of the .h file is causing the compiler to misinterpret something at the beginning of the .c file. |
|
#5
|
|||
|
|||
|
Re: Compile failure
Doing a Build All doesn't change anything; the error still appears.
All I added was the following after the #defines for OPEN and CLOSE. They're all used in user_routines.c: Code:
#define PI 3.14159265 // Defines pi for use in converting radians to degrees & vice versa #define LENGTH 34 // Defines the distace between wheels along the length of the robot in inches #define WIDTH 21 // Defines the distace between wheels along the width of the robot in inches #define MAX_DEFLECTION 0.78539814 // Defines the maximum angle at which the robot will turn (measured at the near wheel to the turn) in radians #define MAX_DIFFERENTIAL 64 //Defines the maximum value by which motors will slow for differential turning. Uses 8-bit value (ie. 55 means that a value of 255 will become 200, 0 will become 55) #define PWM_NEUTRAL 2 //Defines the range at which a pwm value is considered neutral (127). (note: value of 6 will result in range of 121-133) #define potentiometer_left rc_ana_in01 //potentiometer on right motor #define potentiometer_right rc_ana_in02 //potentiometer on left motor Also, note the edit in my last post. |
|
#6
|
|||||
|
|||||
|
Re: Compile failure
It definitely makes a difference! The IFI-provided code is compatible with C18 version 2.4, which is the version on the CD-ROM in the Kit of Parts. It is not compatible with any later version of the compiler.
|
|
#7
|
|||
|
|||
|
Re: Compile failure
Sorry, I should have been clearer. That's only the machine I'm on right now. I get the same thing on another machine I have running whatever C18 was on the CD. Both are running MPLAB 8.0, though.
|
|
#8
|
|||
|
|||
|
Re: Compile failure
Without the full project, we're making guesses based upon previous experience.
One way of trying to fix this is to add the following line to user_routines_fast.c before any other #include directives. Code:
#include "p18f8722.h" PIC18F8722 Then do: Project->Clean Project->Build all Report any errors. Are there no warnings or messages in the output before this? What is the specific error line, "'J:\*\" should be "J:\<dir1>...\" MPLAB is path length sensitive..., what is the exact error message output. I added the defines to my project and it compiled/linked ok so it is something else either within the source files or within the build environment. |
|
#9
|
|||
|
|||
|
Re: Compile failure
Okay, I uninstalled and reinstalled everything and copied my code over into a new project, and now things are working. Seems like I probably screwed something up while playing around with settings, possibly twice. Thanks anyway.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| motor failure | redbarron | Electrical | 5 | 22-02-2006 10:52 |
| Camera glitch / failure | Eldarion | Control System | 2 | 19-02-2006 18:43 |
| Warning: Motor Failure | JVN | Motors | 13 | 08-02-2005 13:54 |
| Robot Test - Failure | Fixen | Rumor Mill | 34 | 07-02-2005 23:20 |
| Failure of Robot Interface | Matt McNelley | Technical Discussion | 23 | 08-04-2003 21:32 |