Sign in to follow this  
the_recon

Inherit problem

Recommended Posts

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???

Share this post


Link to post
Share on other sites
Hmm, not sure. Did you make sure to use public inheritance?

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

class DerivedCameraClass : public BaseCameraClass
{
public:
// ...
};

Share this post


Link to post
Share on other sites
[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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this