swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two -getX()'s?


From: Ken Cline
Subject: Re: Two -getX()'s?
Date: Fri, 3 Sep 1999 21:16:00 -0400 (EDT)

On Fri, 3 Sep 1999, donalson wrote:

> Marcus,
> 
>    I am having some compile trouble.  I have an object "mussel" (the
> animals that grow in the intertidal zone) that has two procedures, -
> (double) getX() and - (double) getY that return the X and Y coordinates
> of the individual.  (I am implementing a continuous space model.)  The
> problem is that the compiler/linker seems to be getting then confused
> with -(int) getX() and - (int) getY() from gui.h.  Shouldn't it be able
> to differentiate between procedures from different objects?  I can
> change my procedure to something like getMusselX but I don't see why
> there should be a problem this way.
> 
> gcc -c -g -O2 -Wall -Wno-import -Wno-protocol   -DAPPNAME=mussel   -DDLL
> -I/Swarm-2.0/include Mussel.m
> Mussel.m: In function `-[Mussel initializeMusselNeighbors]':
> Mussel.m:26: warning: multiple declarations for method `getX'
> \Swarm-2.0\include\gui.h:106: warning: using `-(int)getX'
> Mussel.h:35: warning: also found `-(double)getX'
> Mussel.m:26: warning: multiple declarations for method `getX'
> \Swarm-2.0\include\gui.h:106: warning: using `-(int)getX'
> Mussel.h:35: warning: also found `-(double)getX'
> Mussel.m:26: warning: multiple declarations for method `getY'
> \Swarm-2.0\include\gui.h:109: warning: using `-(int)getY'
> Mussel.h:36: warning: also found `-(double)getY'
> Mussel.m:26: warning: multiple declarations for method `getY'
> \Swarm-2.0\include\gui.h:109: warning: using `-(int)getY'
> Mussel.h:36: warning: also found `-(double)getY'

BTW, you can probably quiet these warnings if you give the
compiler some more information, for example:

   [ (Mussel *)obj getX ];

or, preferably,

   [ (id <ContinuousSpatialObject>)obj getX ];

I don't think its fair to say that the compiler is confused;
I think it trying to make sure *you* are not confused. =;-)

Ken.

_________________________________________________________
Ken Cline                             address@hidden
SAIC                                 VOICE (410) 571-0413
Annapolis, MD                          FAX (301) 261-8427




                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]