Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   PROGRAMMING PROBLEM HELP! (http://www.chiefdelphi.com/forums/showthread.php?t=61016)

Chris1228 07-01-2008 21:44

PROGRAMMING PROBLEM HELP!
 
Hey as the title states i have a problem with mp lab and would like some assistance. I am using the FRC Code_2007_8722 and when i go to build the program i get this error message "C:\Documents and Settings\Christopher\Desktop\frc-code-2007-8722\FrcCode_2007_8722\user_SerialDrv.c:52:Error: syntax error"

and my code where te error supossively is :
"typedef DeviceStatus *DeviceStatusPtr;

//static PANEL_INPUT_RECORD dataIn; /* data input buffer (from Breaker Panel) */
static unsigned char IntState;
static panel_bitid bpFlags; [/color]
static DeviceStatus dcb[TOTAL_SERIAL_PORTS]; /* device control block */
unsigned char aBreakerWasTripped;
static char rom2ramBufr[12];
" with the error arrow at the line static panel.
What do i do? help please

Laaba 80 07-01-2008 21:52

Re: PROGRAMMING PROBLEM HELP!
 
Quote:

Originally Posted by Chris1228 (Post 671781)
static panel_bitid bpFlags; [/color]

I'm not sure what you are trying to do here, but I have never seen anything put after a semicolon. I'm not sure if you were trying to comment out COLOR, or if it serves a purpose. May be something to look at, but I'm not guaranteeing thats the problem, so dont go to crazy with it. Hope it helps.
Joey

Chris1228 07-01-2008 22:01

Re: PROGRAMMING PROBLEM HELP!
 
typedef DeviceStatus *DeviceStatusPtr;

//static PANEL_INPUT_RECORD dataIn; /* data input buffer (from Breaker Panel) */
static unsigned char IntState;
static panel_bitid bpFlags;

static DeviceStatus dcb[TOTAL_SERIAL_PORTS]; /* device control block */
unsigned char aBreakerWasTripped;
static char rom2ramBufr[12];

"sorry that color part was a typo" see anything else wrong? i really need 2 fix this problem

Kevin Sevcik 07-01-2008 22:16

Re: PROGRAMMING PROBLEM HELP!
 
First, considering the length of your path to that file, you're running perilously close to the 64 character limit for the files path for the compiler. I'd consider moving the code from your desktop to a root directory.

Second, have you previously defined DeviceStatus somewhere?

Chris1228 07-01-2008 22:22

Re: PROGRAMMING PROBLEM HELP!
 
ok so where should i move the code to?

Ryan O 07-01-2008 22:36

Re: PROGRAMMING PROBLEM HELP!
 
I keep mine in a folder directly on the C drive, and it seems to work.

Also, what are you doing with that last line? is that an arguement or an atempt at an array/vector, becuas eif so that may be it. I don't know about that in this enviroment, so it may be entirely legal.

Course, the file length may be your problem anyway, so try that before anything else.

:)

jdejoannis 07-01-2008 22:37

Re: PROGRAMMING PROBLEM HELP!
 
The path length limit would probably create a whole mess of error messages.

The C programming language is quite free form. You can put anything you want after a semicolon, including another command or comments. It is quite common to see these type of comments.

I cannot see any problems with your code. So that means add each line one at a time and see which one produces the error. You can facilitate that by commenting them out.

/Jason

Chris1228 07-01-2008 22:42

Re: PROGRAMMING PROBLEM HELP!
 
Well i tried moving the code into a folder directly in the c drive and recieved the same error message. should i try putting the lines of code in one at a time to see which one produces the error?

Chris1228 07-01-2008 22:43

Re: PROGRAMMING PROBLEM HELP!
 
And none of my programs will build is that a problem with mp lab?

Mark McLeod 08-01-2008 10:11

Re: PROGRAMMING PROBLEM HELP!
 
Since you've modified the default code it is probably something earlier that caused the error you're seeing.

Try compiling an original version of the default code and get that working first.

Jon Stratis 08-01-2008 11:12

Re: PROGRAMMING PROBLEM HELP!
 
First off, a quick google search revealed your SVN repository, so you might want to protect that. That being said, i took a look over your source, and couldn't find anything that looked wrong.

One problem i've had in the past taht's really hard to find is line endings - Unix line endings are different from the DOS ones, and if you accidentally intermix them in a file, some compilers will start throwing fits. In the definition of PANEL_INPUT_RECORD in your header file, you have a variable of type panel_bitid, so it's a fairly safe bet that it's not the struct that's causing the problem.

Chris1228 08-01-2008 19:37

Re: PROGRAMMING PROBLEM HELP!
 
so what should i do? i dont have anyother variation of a default code

Mark McLeod 09-01-2008 11:58

Re: PROGRAMMING PROBLEM HELP!
 
Use the original released by IFI: http://www.ifirobotics.com/docs/frc-code-2007-8722.zip
The code snippet you posted earlier shows a line commented out, so it's been modified from the original.

Make sure the original compiles "as is" for you, then start adding your modifications, compiling and checking each modification as it's added. You'll catch where you've gone wrong.

ubergeek5075 09-01-2008 12:19

Re: PROGRAMMING PROBLEM HELP!
 
Whenever we have a syntax error in our code, and our code on the line and after the line is grammatically correct, our next step is to make sure we aren't defining something previously defined.

Then we look at the code above it for syntax errors. For instance, if you have a line of code before that like this:

int new_variable

and forget the semicolon, then it will cause the error on the next line following. Same goes for braces and brackets, etc.

The only other thing i can think of is that the typedef is inside a function, which causes problems.


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

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