Tamas Marki wrote:
> On 12/26/07, Michael Sullivan <[EMAIL PROTECTED]> wrote:
>> In my project I have moved the majority of SDL code from the Battle
>>  class to a new class called DrawBattle.  I'm trying to build it, but
>>  DrawBattle refuses to recognize my Battle class.  I know that this isn't
>>  finished, but I prefer to debug and rebuild as I go.  I have pasted the
>>  code for only the relevant classes:
> 
> [snip code]
> 
> I didn't really read through all your code, but it seems like that you
> are falling into the 'recursive includes' trap, meaning that battle.h
> includes drawbattle.h and vice versa. Just think about it for a moment
> what would you do if you were the preprocessor... Confused yet? :)
> You might need to rethink that part a bit.
> HTH

He does have the #ifdef/#ifndef's in place.  If there were a recursive 
problem, the compiler would have died there.

Michael, try this:

Remove the 'drawbattle.h' #include from 'battle.h'.  Then, before your 
declaration of Battle, do:


class DrawBattle;


That tells the compiler that somewhere else is going to be a full class 
definition of DrawBattle.  This is the usual approach to dealing with 
circular references.

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to