swarm-support
[Top][All Lists]
Advanced

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

Have you ever seen a compiler error message like this?


From: Paul Johnson
Subject: Have you ever seen a compiler error message like this?
Date: Thu, 6 Nov 1997 00:01:57 -0600 (CST)

It's not easy figuring out compiler errors. 

I've been adding code in ModelSwarm.m to add functionality in a
project. I've tried to build the code inside the buildObjects
section, just to debug and make sure calculations are correct.  I
put in lots of printf commands to monitor the stages.

 Now I want to move that code
out to a different file/object and integrate into a Swarm-style project.
 
That new object is in Setter.h and Setter.m, and in ModelSwarm.h
I've added a import statement for Setter.h and a new variable type 
        Setter * aSetter
and in ModelSwarm I add the usual bit to create the object under
buildObjects:  

        aSetter = [Setter createBegin: [self getZone]];
        [aSetter setWorld: world];
        aSetter = [aSetter createEnd];
//here is the call to aSetter's method, FYI
        [aSetter  evaluate: voterList P: proposal C: current]  ;

Whenever I leave the first line of that code in the program, the compiler error
is this (hence, I dont think the problem is in the 4th line):  

 ModelSwarm.o: In function `_c_ModelSwarm__createBegin_':
/swarm/swarmapps/majority03/ModelSwarm.m:18: undefined reference to
`__objc_class_name_Setter'
make: *** [Voter] Error 1

Now here is what puzzles me.  Here is ModelSwarm up through line 18:


// ModelSwarm.m                                 simpleSwarmBug2

#import "ModelSwarm.h"
#import <simtools.h>
#import "CountHeads.h"
#import <collections.h>
#import "dimarray.h"
#import "Setter.h"



@implementation ModelSwarm  

+createBegin: (id) aZone {
  ModelSwarm * obj;


  obj = [super createBegin: aZone];



The 18th line is the call to the super class to createBegin. Go figure.
Then Please explain.

I've tried to recode this many times and I keep ending up back 
at the same point.  I'm able to write the code to do what I want
and put it in the middle of ModelSwarm, but when I try to put it
out, under the control of the Setter object, I get this one. 

Maybe, while I'm at it, I'll ask one more coding question.  I'm following
the standard heatbugs/tutorial approach where the build objects creates
a list of agents.  I'm wanting then to pass that list to the Setter
object.  There's no reason I can't do that, is there?  WHen the list
gets passed, it takes all the information about the individual agents 
with it, doesn't it, so that inside Setter.m, one can access the
information inside each object by the appropriate message. Right?




Paul E. Johnson                           address@hidden
Dept. of Political Science                Office: (913) 864-9086
University of Kansas                      FAX: (913) 864-5700
Lawrence, Kansas 66045                    Home: (913) 842-9916                  
   


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