Aaron repied:
>
> > I was still unable to compile receiving the following error:
> >
> > /prc-tools/H-i586-cygwin32/m68k-palmos/lib/gcrt0.o(.text+0x6a):crt0.c:
> > undefined reference to `PilotMain'
>
> did you declare PilotMain()?? :)
>
Yes, I did. After two days of fruitless effort I have found a
workaround to the problem, which is not elegant, but it works.
What I did, add an include to my main project file, so I now have
myProject.c and as a line in this file: #include "MathLib.c"
I am absolutely new to C, C++, GNU and whatever else is available
for the Palm. I just got mine a few weeks ago.
As a Java programmer, I am used to object oriented design.
Every class in it's own file, and let the compiler build
the classes, eventually storing everything in a *.jar file.
Because of this history, I tought it would work the same with
the '*.c' files. Build several files and combine them into
one '*.prc' file.
This is the compile.bat I was using:
--------------------------- Compile.BAT --------------------------
@echo off
@cls
@if exist *.bin del *.bin
@if exist *.grc del *.grc
@if exist LandingDistance.o del LandingDistance.o
@if exist LandingDistance del LandingDistance
@if exist LandingDistance.prc del LandingDistance.prc
echo compile the resource files
pilrc.exe LandingDistance.rcp
echo Step 1 -----------------------------------------------------
m68k-palmos-gcc -g -DDEBUG -c MathLib.c -o MathLib.o
m68k-palmos-gcc -g -DDEBUG -c LandingDistance.c -o LandingDistance.o
echo Step 2 -----------------------------------------------------
m68k-palmos-gcc -g -DDEBUG MathLib.o -o MathLib
m68k-palmos-gcc -g -DDEBUG LandingDistance.o -o LandingDistance
echo Step 3 -----------------------------------------------------
m68k-palmos-obj-res MathLib
m68k-palmos-obj-res LandingDistance
echo Step 4 -----------------------------------------------------
build-prc LandingDistance.prc "LandingDistance" COUN *.grc *.bin
echo Step 5 -----------------------------------------------------
@del *.bin > nul
@del LandingDistance.o > nul
@del *.grc > nul
@del LandingDistance > nul
echo ------------------------------------------------------------
echo Compile done -----------------------------------------------
echo ------------------------------------------------------------
exit
----------------------end of Compile.BAT -------------------------
After working around the problem, I now see that the error must be
in step 2, because MathLib.o was generated. But it does not have
a PilotMain()!!!
So my question now comes down to:
How can I compile several separate '*.c' files into one '*.prc'file??
Thanks for bearing with me so far.
Kind regards
Bert Ruiterkamp
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/