Invalid Base Class Error

I've a base class declared in header file named A which contains two pure virtual functions along with few normal functions that are not defined. I create another class B in the same header file that inherits from A. Class B doesn't define any of its own functions other than the constructor. Visual studio is giving me invalid base class error

http://www.cplusplus.com/forum/articles/40071/#msg216270


> I've a base class declared in header file named A...
post code.
class Model2D{
private:
Vector2f position;
Vector2f frontVector;
float speed;
float vertices[] = {
-1,1,
-1,-1,
1,-1,
1,1
};

public:
Model2D(const Vector2f& pos, const Vector2f& fv, float speed);
virtual void move() = 0;
virtual void render() = 0;

float getSpeed();
void setSpeed(float speed);

Vector2f getPosition();
Vector2f getFrontVector();
};


//Compiler shows that Model2D is invalid base class
class StaticModel2D : public Model2D {
public:
StaticModel2D(const Vector2f& pos);

};



class DynamicModel2D :public Model2D {
public:
DynamicModel2D(const Vector2f& pos, const Vector2f& fv, float speed);
};
Last edited on
I just had to move the array initialization into constructor
Topic archived. No new replies allowed.