David,

When I've encountered problems like this it's been due to bugs in header files, in a 
#define in a header file, or in a prefix file. One thing that may help you locate the 
problem is to look at the preprocessed version of the source file. Assuming you're 
using CodeWarrior you can right-click the source file in your project listing and 
choose "Preprocess". This shows the actual text being sent to the compiler, after 
accounting for headers, #defines and the prefix file.

>From the error you're reporting I would guess that you have an extra keyword in some 
>file that's implicitly or explicitly included in your source file. Looking through 
>the preprocessed source file may make it obvious.

         -Bob Whiteman

=====================
Developer Technical Services Engineer - Comms
PalmSource, Inc.
=====================

-----Original Message-----
From: David Beers [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 9:39 AM
To: Palm Developer Forum
Subject: previously compilable code now chokes CW


I've been working on a project that uses the MemoPad source as a starting
point.  All has gone well up until now and I've successfully compiled and
tested various versions.  Then I made some modifications to handle
additional text fields and record structures to accept the data.  Suddenly,
the code generates compile errors on the very first line after the
preprocessor directives in the first file of the project--code that has
compiled before and hasn't been changed.

Specifically, the compiler hits the first definition for a typedef structure
and tells me that it expected a '{' after the typedef keyword.  Usually this
kind of thing indicates a syntax error in a previous line, but there are no
previous lines except for some #defines and these haven't been changed at
all.  In fact this part of the code hasn't changed from the original MemoPad
source.

Not having the faintest clue what might cause the CW compiler to fail on
code that worked perfectly fine before, I tried some different things
(obviously grasping at straws):
1.  Retracing some of my recent steps, most notably replacing a file that
contained functions for beaming that I didn't need and restoring the calls
to those functions to the way they were in MemoPad.
2.  Checking the original MemoPad code to make sure it still compiles
normally.  It does.
3.  Shifting around the file order within the segment.
4.  Creating a fresh project and recreating the files in it.

None of this changed the situation.  Is it possible that a syntax error
farther down in the file could cause code that precedes it to fail to
compile? If not, what else could be the cause of this?

TIA,
David


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to