Go to Post Limits are imposed by both man and nature. Understanding those limits and attempting to push past them is the basis of creativity. - Dave.Norton [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 02-04-2007, 12:02 PM
fallen751 fallen751 is offline
Registered User
FRC #2052
 
Join Date: Jan 2007
Location: Minnesota
Posts: 17
fallen751 is an unknown quantity at this point
get_tracking_state()

I have a question about how to use get_tracking_state(). I have included the tracking.h header file in my code, and I call the function in a normal if statement like this: if (get_tracking_state() == CAMERA_ON_TARGET)
{
our code;
}
anyways no where in user_routines_fast.c have I defined get_tracking_state(), and the only reason it compiles most of he way is because its prototyped in tracking.h. So my question is how I do I define it, or is there a global variable I can use that will suit my need.

The error I get at the end of the compile looks like this;
MPLINK 3.90, Linker
Copyright (c) 2004 Microchip Technology Inc.
Error - could not find definition of symbol 'get_tracking_state' in file 'C:\Feb 3rd\frc_camera_21\user_routines_fast.o'.
Errors : 1

thanks for any help!!!
  #2   Spotlight this post!  
Unread 02-04-2007, 12:28 PM
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,112
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: get_tracking_state()

The function prototype is in tracking.h which you should #include at the beginning of any file which uses it. The function definition is in tracking.c which you should have added to your project at the same time tracking.h was added.

Did you actually add the files to your project using MPLAB, or did you just copy them to the directory with your code?
  #3   Spotlight this post!  
Unread 02-04-2007, 12:34 PM
fallen751 fallen751 is offline
Registered User
FRC #2052
 
Join Date: Jan 2007
Location: Minnesota
Posts: 17
fallen751 is an unknown quantity at this point
Re: get_tracking_state()

hey I included the tracking.h and tracking.c is included in my project, but I get this error!
Code:
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\camera.o".
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\camera_menu.o".
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\eeprom.o".
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\ifi_startup.o".
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\ifi_utilities.o".
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\main.o".
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\serial_ports.o".
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\terminal.o".
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\tracking.o".
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\tracking_menu.o".
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\user_routines.o".
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\user_routines_fast.o".
Clean: Deleted file "C:\Feb 3rd\frc_camera_21\pwm.o".
Clean: Done.
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "camera.c" -fo="camera.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "camera_menu.c" -fo="camera_menu.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "eeprom.c" -fo="eeprom.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "ifi_startup.c" -fo="ifi_startup.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "ifi_utilities.c" -fo="ifi_utilities.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "main.c" -fo="main.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "serial_ports.c" -fo="serial_ports.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "terminal.c" -fo="terminal.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "tracking.c" -fo="tracking.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "tracking_menu.c" -fo="tracking_menu.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
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
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "user_routines_fast.c" -fo="user_routines_fast.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
C:\Feb 3rd\frc_camera_21\user_routines_fast.c:233:Warning [2058] call of function without prototype
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8722 "pwm.c" -fo="pwm.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066 -D_FRC_BOARD
Executing: "C:\mcc18\bin\mplink.exe" /l"C:\mcc18\lib" "18f8722.lkr" "C:\Feb 3rd\frc_camera_21\camera.o" "C:\Feb 3rd\frc_camera_21\camera_menu.o" "C:\Feb 3rd\frc_camera_21\eeprom.o" "C:\Feb 3rd\frc_camera_21\ifi_startup.o" "C:\Feb 3rd\frc_camera_21\ifi_utilities.o" "C:\Feb 3rd\frc_camera_21\main.o" "C:\Feb 3rd\frc_camera_21\serial_ports.o" "C:\Feb 3rd\frc_camera_21\terminal.o" "C:\Feb 3rd\frc_camera_21\tracking.o" "C:\Feb 3rd\frc_camera_21\tracking_menu.o" "C:\Feb 3rd\frc_camera_21\user_routines.o" "C:\Feb 3rd\frc_camera_21\user_routines_fast.o" "C:\Feb 3rd\frc_camera_21\pwm.o" "C:\Feb 3rd\frc_camera_21\FRC_alltimers_8722.lib" /o"camera.cof" /M"camera.map"
MPLINK 3.90, Linker
Copyright (c) 2004 Microchip Technology Inc.
Error - could not find definition of symbol 'get_tracking_state' in file 'C:\Feb 3rd\frc_camera_21\user_routines_fast.o'.
Errors    : 1

BUILD FAILED: Sun Feb 04 11:33:37 2007
  #4   Spotlight this post!  
Unread 02-04-2007, 12:44 PM
fallen751 fallen751 is offline
Registered User
FRC #2052
 
Join Date: Jan 2007
Location: Minnesota
Posts: 17
fallen751 is an unknown quantity at this point
Re: get_tracking_state()

oh! I figured it out, apparently I added in extra space before my if statement like if (get_camera_state() == CAMERA_ON_TARGET), so I had to delete the space like this if(get_camera_state() == CAMERA_ON_TARGET). thanks for your help!
  #5   Spotlight this post!  
Unread 02-04-2007, 12:45 PM
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,112
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: get_tracking_state()

The name of the function is Get_Tracking_State(). Capitalization matters.
  #6   Spotlight this post!  
Unread 02-05-2007, 05:54 AM
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: get_tracking_state()

Quote:
Originally Posted by fallen751 View Post
oh! I figured it out, apparently I added in extra space before my if statement like if (get_camera_state() == CAMERA_ON_TARGET), so I had to delete the space like this if(get_camera_state() == CAMERA_ON_TARGET). thanks for your help!
That shouldn't affect it at all. C is virtually always whitespace (ie, spaces, tabs, newlines) insensitive.

If you fixed the case of your function call, that's what solved your problem. If you didn't (and left it lower case), I would really appreciate knowing that... always have to be on the lookout for the dumb quirks of the compiler.
__________________

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


All times are GMT -5. The time now is 02:36 PM.

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