   class hierarchy problem
  Hello!Before starting my post, I'd just like to mention that I am not looking for a better class design, I just want to make mine work.Now that I have some experience with OpenGL, I'm starting my first game using c++ in 2D. I have a class hierarchy that I find somewaht complex like this :class CEntity {}; // About everythingclass CPhysicalEntity : CEntity {}; // A game object class CCreature : CPhysicalEntity {}; // A creature (with HP)class CBackgroundObject : CPhysicalEntity {}; // Something in BGclass CMap : CEntity(); // A game level/menuEach class contains virtual functions, including some pure virtual functions.My problem is that, for some reason, using this class hierarchy makes it impossible to store a vector of CCreature*. In fact, I cannot store any class pointer which is not CEntity*. I get the following warning : "warning C4150: deletion of pointer to incomplete type 'Game::CCreature'; no destructor called"This is very bad because when I will be creating CCreature-derived class (for example : CKamikazeBlob), it's destructor won't get called upon deletion.I don't know how to solve this problem, I've tryed virtual destructors but it didn't work, unless I didn't use them correctly (which could be possible).If someone could help me, I'd greatly appreciate it!   
  There is no problem with the above code, other thanclass CMap : CEntity();which should really beclass CMap : CEntity {};Please post the code for classes CCreature, CPhysicalEntiry and CEntity, including constructors and destructors.   ;  It might well be possible that you delete a pointer at a point in code from where the definition of your class is not visible (only a declaration is). What specific line causes this warning, and have you used forward declarations instead of definitions nearby?   ;  Okay, I'm going to post some code, i'll start by CEntity and CPhysicalEntity. I hope it will be enoughentity.h [excluding include gards, #includes, etc.]namespace Game{class CEntity{protected:bool _Deletable;public:CEntity() : _Deletable(false) {}virtual ~CEntity() {}// Can we delete it?inline bool isDeletable() const { return _Deletable; }// Update and rendervirtual void init() {}virtual void render() {}virtual void renderStatic(FECL::Rect2D * rect = 0, FECL::Color4D * color = 0) {}virtual void update(float timedelta) {}virtual void destroy() {}// Get a class instancevirtual CEntity * getClassInstance() = 0;// Load or save itselfvirtual bool load(FECL::IOReader & reader) { return false; }virtual bool save(FECL::IOWriter & writer) { return false; }};};physicalentity.h [excluding include gards, #includes, etc.]namespace Game{class CScene;class CPhysicalEntity : public CEntity{public:CScene  * _CurrentScene;FEGL::CSprite  _Sprite;FECL::Vector2D _Velocity;CPhysicalEntity(CScene * scene = NULL) : _CurrentScene(scene) {}// Update and rendervoid render() { _Sprite.render(true); }void renderStatic(FECL::Rect2D * rect = 0, FECL::Color4D * color = 0) { _Sprite.render(true); }};};The problem occurs in a file which has a std::map of CPhysicalEntity* in which I whish to store the enemies of a level. In this class's destructor, I iterate through the std::map and delete every object pointer before clear()ing the map. The compiler points the line "for(entit = _Entities.begin() ; entit != _Entities.end() ; entit++) delete entit->second.second;"Thanks   ;Quote:Original post by ToohrVykIt might well be possible that you delete a pointer at a point in code from where the definition of your class is not visible (only a declaration is). What specific line causes this warning, and have you used forward declarations instead of definitions nearby?Actually, that was it. Please forgive me of having took some of your time for my newbe error.Thanks to both of you!   