• Create Account

### #ActualAndy474

Posted 01 March 2013 - 09:27 AM

Don't you need to #include the files?

At the top of "CHealthBar.h" do #include "CEntity.h"  to tell the compiler you are using the class defined in the file, else it wont know what CEntity is and likewise in the other file.

You may also need to pre-define the classes, so at the top of CHealthBar ... I vaguly remeber having toto this in my last game.

#ifndef _CHEALTHBAR_H_
#define _CHEALTHBAR_H_

#include "SDL.h"
#inlcude "CEntity.h";

class CEntity;

class CHealthBar
{ ...


And likewise in the other file, hope this help

-edit: all the bad types and code tags

### #5Andy474

Posted 01 March 2013 - 09:26 AM

Don't you need to #include the files?

At the top of "CHealthBar.h" do #include "CEntity.h"  to tell the compiler you are using the class defined in the file, else it wont know what CEntity is and likewise in the other file.

You may also need to pre-define the classes, so at the top of CHealthBar ... I vaguly remeber having toto this in my last game.

#ifndef _CHEALTHBAR_H_
#define _CHEALTHBAR_H_

#include "SDL.h"
#inlcude "CEntity.h";

class CEntity;

class CHealthBar
{ ...


And likewise in the other file, hope this help

-edit: all the bad types and [code=auto:0] tags

### #4Andy474

Posted 01 March 2013 - 09:25 AM

dont you need to #include the files

so at the top of CHealthBar do #include "CEntity.h" and likewise in the other file?

you might also need to pre define th classes, so at the top of CHealthBar

#ifndef _CHEALTHBAR_H_
#define _CHEALTHBAR_H_

#include "SDL.h"
#inlcude "CEntity.h";

class CEntity;

class CHealthBar
{ ...


and likewise in the other file.

### #3Andy474

Posted 01 March 2013 - 09:23 AM

dont you need to #include the files

so at the top of CHealthBar do #include "CEntity.h" and likewise in the other file?

you might also need to pre define th classes, so at the top of CHealthBar

#ifndef _CHEALTHBAR_H_
#define _CHEALTHBAR_H_

#include "SDL.h"
#inlcude "CEntity.h";

class CEntity;

class CHealthBar
{ ...


### #2Andy474

Posted 01 March 2013 - 09:23 AM

dont you need to #include the files

so at the top of CHealthBar do #include "CEntity.h" and likewise in the other file?

you might also need to pre define th classes, so at the top of CHealthBar

[code lang="c++"]

#ifndef _CHEALTHBAR_H_
#define _CHEALTHBAR_H_

#include "SDL.h"
#inlcude "CEntity.h";

class CEntity;

class CHealthBar
{

[code=auto:0]

### #1Andy474

Posted 01 March 2013 - 09:23 AM

dont you need to #include the files

so at the top of CHealthBar do #include "CEntity.h" and likewise in the other file?

you might also need to pre define th classes, so at the top of CHealthBar

[code=auto:0]

#ifndef _CHEALTHBAR_H_
#define _CHEALTHBAR_H_

#include "SDL.h"
#inlcude "CEntity.h";

class CEntity;

class CHealthBar
{

[code=auto:0]

PARTNERS