Hi,
I posted this to the gcc newsgroup but there doesn't seem to be a whole lot
of activity. I hope this is not too off-topic. If so, please feel free to
guide me as I am new to this list.
I just started with the GNU compiler and I'm running into an error that's
driving me crazy. Quite possibly, someone here can recognize the problem
immediately. Basically, when I compile my .c file it compiles without error.
However, as soon as I add the following code :
static Err zpcSendData(UInt serRefNum, CharPtr data, ULong bytes)
{
Err err = 0;
// flush any old data from serial input
SerReceiveFlush( serRefNum, 0 );
// Output the command to the serial port
SerSend( serRefNum, data, bytes, &err );
return err;
}
I get the following error :
m68k-palmos-coff-gcc -O2 -g -c PalmCaddy.c -o PalmCaddy.o
PalmCaddy.c: In function `zpcSendData':
PalmCaddy.c:426: `FUNCTION' undeclared (first use this function)
PalmCaddy.c:426: (Each undeclared identifier is reported only once
PalmCaddy.c:426: for each function it appears in.)
PalmCaddy.c:426: parse error before `:'
make: *** [PalmCaddy.o] Error 1
This is not the error that I was getting at first. When I moved the
offending code to another place in the file, the error changed. Line 426
refers to the blank line directly above the zpcSendData function.
Here is the error when I moved the function to near the top of the file :
m68k-palmos-coff-gcc -O2 -g -c PalmCaddy.c -o PalmCaddy.o
PalmCaddy.c: In function `zpcSendData':
PalmCaddy.c:453: parse error at end of input
make: *** [PalmCaddy.o] Error 1
Line 453 corresponds to a comment line directly above PilotMain which is at
the very bottom of the file.
I would appreciate any guidance you might have to offer. Please be patient
with me. It will take me awhile to get to know the compiler.
TIA,
Eric Oliver