swarm-support
[Top][All Lists]
Advanced

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

REPOST: compiler error passing method


From: Steve Emsley
Subject: REPOST: compiler error passing method
Date: Mon, 4 Aug 1997 21:35:01 +0100

Hi,

Kevin ... Thank's for you input. I don't think I've made a typo or not
declared a method prior to using it. However, I may have so I'm now going
to declare the problem as is ...

main.m
#import <simtools.h>
#import "POModel.h"
#import "LightTable.h"

int 
main(int argc, char ** argv) {
  id theTestSwarm, theLightSwarm;
  int i;
  
  initSwarm(argc, argv);

  theLightSwarm = [LightTable create: globalZone];
  theLightSwarm = [theLightSwarm createEnd];

  theTestSwarm = [POModel create: globalZone];
  theTestSwarm = [theTestSwarm createEnd];
  [theTestSwarm setLightSpace: theLightSwarm];
  [theTestSwarm test];
  
  return 0;
}

LightTable.m contains a method bcalled spectral and POModel.m contains
a method called setLightSpace: (id) l

-(void)setLightSpace: (id) l { lightSpace = l; return ; }

where lightSpace is declared type id in POModel.h and setLightSpace is also
declared. However, when I call the method:

-(void) test {
  double tmp;
  tmp = [lightSpace spectral: 50];
  printf("%d\n",tmp);
  return;
}

I get the error message:

OModel.m: In function `_i_POModel__test':
POModel.m:665: warning: cannot find method.
POModel.m:665: warning: return type for `spectral:' defaults to id
POModel.m:665: incompatible types in assignment
POModel.m:666: warning: int format, double arg (arg 2)
make: *** [POModel.o] Error 1


I may be missing something from the swarm code since all I do is use the
main.m as defined and create the classes. It worked OK in testing the class
LightTable (but that class doesn't communicate with any others).

Any suggestions would be extremely helpful ... at least I've still got some
hair left!!

Regard,
Steve.
-- 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Steve Emsley                   Ecosystems Analysis & Management Group
 address@hidden         University of Warwick, England
 http://www.oikos.warwick.ac.uk/~sme/             (+44) (0)1598 753648
-----------------------------------------------------------------------
Life would be so much easier if we could just look at the source code.

                  ==================================
   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]