I am a fairly experienced programmer, but I'm just getting started with Palm
OS programming. I'm presently working out of the new _Palm_Programming_, by
Glenn Bachmann. The bulk of the code is from his first full example. I am
using the GNU C/C++ compiler and the Palm SDK 3.0, on a Windows NT machine.
My source file #includes Pilot.h and SysEvtMgr.h
When I attempt to compile with the following command
m68k-palmos-coff-gcc -O1 my_main.cpp
I get this error:
In file included from
e:\\palm\\GnuPP\\lib\\gcc-lib\\m68k-palmos-coff/2.7.2.2-kgpd-071097/include/
PalmOS/System/SysAll.h:67,
from
e:\\palm\\GnuPP\\lib\\gcc-lib\\m68k-palmos-coff/2.7.2.2-kgpd-071097/include/
PalmOS/Pilot.h:76,
from my_main.cpp:7:
e:\\palm\\GnuPP\\lib\\gcc-lib\\m68k-palmos-coff/2.7.2.2-kgpd-071097/include/
Palm
OS/Common.h:252: parse error before `false'
The following is the region of Common.h in question:
240: // Include the following typedefs if types.h wasn't read.
241: #ifndef __TYPES__
242: #ifdef __MWERKS__
243: #if !__option(bool)
244: #ifndef true
245: #define true 1
246: #endif
247: #ifndef false
248: #define false 0
249: #endif
250: #endif
251: #else
252: enum {false, true};
253: #endif
254: #endif /* __TYPES__ */
I've tried omitting the optimization switch. Oh, and this is weird, Common.h
is not in the directory that GPP says it is. I have three copies:
E:\palm\winsdk30\Unsupported\PalmOS Emulator\Src\Source_Shared\Includes\Palm
- I don't think it's using this one :)
E:\palm\GnuPP\m68k-palmos-coff\include\PalmOS
- This is the closest to the named path
E:\palm\winsdk30\Incs
I don't know why GCC is reporting an incorrect path (in fact, a nonexistant
path!), but it is clearly parsing Common.h.
The version of Common.h from GNU is 8KB, and is from 6/18/97. The version in
SDK 3.0 is 10 KB and is from 6/17/98, and it looks like GCC is using the
older version, so this could be the problem, or a second problem.
But how do I tell GCC to use the other set of headers? Is there a
command-line switch for this? Note that I am not using a makefile.
Thanks in advance for any help!
-Sven