swarm-support
[Top][All Lists]
Advanced

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

Re: interface declaration


From: Daniel Calhoun
Subject: Re: interface declaration
Date: Fri, 22 Sep 2000 10:02:28 -0700

Marcus--

Sorry to keep coming back to this problem, but in the process of seeming to
find a solution, I have encountered some specifically erratic behavior,
along with one piece of information that may tell you what is happening.

You advise:
> 
> #import what is immediately required and nothing else.  There is no
> harm in redundent #imports (which you may get when you import
> something for the .m file that is already needed for the .h file),
> since the point of #import is to avoid redundant inclusion.  Don't depend
> on a header's (.h) imports to provide files for the implementation (.m). 

What happens:

First, here is the header stuff for what may be a culprit file.  

--------------------------------------------

// ModelSwarm.m                                 

// #import "Band.h"  
#import "ModelSwarm.h"
#import <random.h>
#import <activity.h>
#import <collections.h>
#import <math.h>

@implementation ModelSwarm  

----------------------------------------------------------------------------
--------------

When I experimented with commenting out the #import "Band.h" line, the
model did compile -- ONCE, only.  Then it went back to producing the
following error, which it now again does, whether or not that #import is in
or commented out.

----------------------------------------------------------------------------
-------------

address@hidden/cygdrive/d/swarmf/swarmapps-1.4.1/plains] $ make
EXTRAOBJCFLAGS=-Wno-error
gcc -c -g -O2 -Wall -Wno-import -Wno-protocol -Werror -Wno-error 
-DAPPNAME=band
   -DDLL  -I/Swarm-2.1.1/include Band.m
In file included from ModelSwarm.h:5,
                 from Band.h:5,
                 from Band.m:3:
Council.h:13: Cannot find interface declaration for `Band', superclass of
`Council'
make: *** [Band.o] Error 1

----------------------------------------------------------------------------
----------------------

The only observable difference had been that, on the compile that did work,
the gcc line did not end with include Band.m, but with include ModelSwarm.m
(or conceivably with include ModelSwarm.h, though my memory says m).  

Does this fluke tell you what was happening or suggest, hopefully, what can
be done to correct it?

-- Dan Calhoun
----------


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