Go to Post Somewhere in New Hampshire at this very moment , the GDC is redesigning the game. - Whippet [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-02-2008, 18:39
darkChozo darkChozo is offline
Some guy
no team
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: a
Posts: 10
darkChozo is an unknown quantity at this point
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
Strange thing is, I haven't modified user_routines_fast.c at all, just user_routines.c and user_routines.h. I've tried replacing basically every other file with clean copies from the default code, and I've compiled the default code itself to make sure that the linker isn't screwed up. Any help?
  #2   Spotlight this post!  
Unread 05-02-2008, 20:18
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
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   Spotlight this post!  
Unread 05-02-2008, 20:51
darkChozo darkChozo is offline
Some guy
no team
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: a
Posts: 10
darkChozo is an unknown quantity at this point
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   Spotlight this post!  
Unread 05-02-2008, 22:45
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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   Spotlight this post!  
Unread 05-02-2008, 22:54
darkChozo darkChozo is offline
Some guy
no team
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: a
Posts: 10
darkChozo is an unknown quantity at this point
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
So far as I can see, I didn't add anything else accidentally.

Also, note the edit in my last post.
  #6   Spotlight this post!  
Unread 05-02-2008, 23:27
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Compile failure

Quote:
Originally Posted by darkChozo View Post
If it makes a difference, I'm running MPLAB 8.0 and C18 3.10
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   Spotlight this post!  
Unread 05-02-2008, 23:53
darkChozo darkChozo is offline
Some guy
no team
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: a
Posts: 10
darkChozo is an unknown quantity at this point
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   Spotlight this post!  
Unread 06-02-2008, 10:29
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
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"
Check Configure->Select Device, make sure device in dialog box is
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   Spotlight this post!  
Unread 06-02-2008, 20:49
darkChozo darkChozo is offline
Some guy
no team
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: a
Posts: 10
darkChozo is an unknown quantity at this point
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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 23:54.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi