When I do the -c bit I get this error:

make clean all 
rm -rf *.o NeoSlate *.bin *.grc *.stamp *~
m68k-palmos-gcc -g -c NeoSlate.c -o NeoSlate.o
m68k-palmos-gcc -g -c BitmapRsrc.c -o BitmapRsrc.o
BitmapRsrc.c: In function `BmpRsrcV3Create':
BitmapRsrc.c:400: warning: comparison is always false due to limited
range of data type
m68k-palmos-gcc -g NeoSlate.o BitmapRsrc.o -o NeoSlate
BitmapRsrc.o(.text+0x0): In function `BmpRsrcGetWidth':
BitmapRsrc.c:236: multiple definition of `BmpRsrcGetWidth'
NeoSlate.o(.text+0xe4):NeoSlate.c:236: first defined here
BitmapRsrc.o(.text+0x14): In function `BmpRsrcGetHeight':
BitmapRsrc.c:237: multiple definition of `BmpRsrcGetHeight'
NeoSlate.o(.text+0xf8):NeoSlate.c:237: first defined here
BitmapRsrc.o(.text+0x2a): In function `BmpRsrcGetRowBytes':
BitmapRsrc.c:238: multiple definition of `BmpRsrcGetRowBytes'
NeoSlate.o(.text+0x10e):NeoSlate.c:238: first defined here
BitmapRsrc.o(.text+0x40): In function `BmpRsrcGetFlag':
BitmapRsrc.c:239: multiple definition of `BmpRsrcGetFlag'
NeoSlate.o(.text+0x124):NeoSlate.c:239: first defined here
BitmapRsrc.o(.text+0x78): In function `BmpRsrcGetVersion':
BitmapRsrc.c:240: multiple definition of `BmpRsrcGetVersion'
NeoSlate.o(.text+0x15c):NeoSlate.c:240: first defined here
BitmapRsrc.o(.text+0x8e): In function `BmpRsrcGetPixelSize':
BitmapRsrc.c:241: multiple definition of `BmpRsrcGetPixelSize'
NeoSlate.o(.text+0x172):NeoSlate.c:241: first defined here
BitmapRsrc.o(.text+0xb0): In function `BmpRsrcGetDensity':
BitmapRsrc.c:248: multiple definition of `BmpRsrcGetDensity'
NeoSlate.o(.text+0x194):NeoSlate.c:248: first defined here
collect2: ld returned 1 exit status
make: *** [NeoSlate] Error 1

Now  am I suppose to compile the BitmapRsrc files into a BitmapRsrc.o
and then into my main program like the above compilation text. Because
this is where I get the errors regarding the above inline functions
which are defined in the BitmapRsrc.h file. The functions aren't even
in Neoslate.c so I don't get why it meantions that code. Now also in
the BitmapRsrc.h file there is the following:
 #ifdef __cplusplus
extern          "C"
{
#endif
All the inline functions are nested inside the above. I assume that
this is only for C++ compiling.

So any ideas ...  

Thanks for any help,

Landon

On 7/28/05, Logan Shaw <[EMAIL PROTECTED]> wrote:
> Landon Cunningham wrote:
> > Ok all the functions that don't seemed to be defined in the
> > BitmapRsrc.c that are causing the problems are defined as inline
> > functions in BitmapRsrc.h. I don't know too much about inline
> > functions and how they work. Should they be implemented in the
> > BitmapRsrc.c?
> >
> > How should I be linking these files?
> >
> > I should have BitmapRsrc.h included in my main program... which leads
> > to how do I connect BitmapRsrc.c in with everything so I don't get
> > undefined references to the functions?
> 
> Your error messages say you're getting an undefined reference to
> PilotMain(), which is not really related to BitmapRsrc stuff.
> 
> I think the problem is that you are missing a "-c" option in
> the command that builds BitmapRsrc.o out of BitmapRsrc.c.
> Without the "-c", the compiler is going to try to take your
> C file and produce a complete executable.  That is, without
> "-c", the compiler assumes the files named on the command line
> are the only source files, and it compiles them, and then links.
> In other words, without "-c", it tries to do all the phases,
> not just compilation.
> 
> You did specify "-o BitmapRsrc.o", but the compiler doesn't care
> that you put ".o" on the end:  it will still try to compile and
> link and create an executable instead of an object file, and
> then name the executable "BitmapRsrc.o".  It doesn't care that
> ".o" is not normally an extension people put on executables.
> 
> So, since you are giving BitmapRsrc.c as the only source file on
> the command line, and since BitmapRsrc.c doesn't have a PilotMain()
> in it and the linker requires one, you get a link error.
> 
>    - Logan
> 
> --
> For information on using the PalmSource Developer Forums, or to unsubscribe, 
> please see http://www.palmos.com/dev/support/forums/
>

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

Reply via email to