Inherit problem

Started by
1 comment, last by Drew_Benton 19 years ago
I have made a CameraClass thar describes a simple camera. My second class inherits from the base class and is a free-looking camera. But when I try to get the camera's position of the free camera, I get this error: S:\PROGGING\Code\PutPixel Dx9b\main.cpp(168) : error C2248: 'vPos' : cannot access public member declared in class 'CDirect3DCamera' If it's public then it SHOULD be able to get it, right???
Js
Advertisement
Hmm, not sure. Did you make sure to use public inheritance?

class BaseCameraClass
{
public:
Vector2 vPos;
// ...
};

class DerivedCameraClass : public BaseCameraClass
{
public:
// ...
};
[lol] Now that's a funny error. When you derived your class did you do it like this:
class base{public:private:}:class derived : public base{public:private:};


If you just do:
class derived : base{public:private:};


That may cause a problem. If not, please post some code of how it is being done.

This topic is closed to new replies.

Advertisement