Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#ActualServant of the Lord

Posted 28 December 2012 - 10:53 PM

I never encountered that error before! happy.png
 
Googling brought up this on the third hit. The first answer in that thread explains the error message.
 
Your code:
class TransformComponent : BaseComponent

...has 'TransformComponent' inherit 'BaseComponent', but didn't specify whether to inherit it publicly or privately. Private is default.

So 'TransformComponent' privately inherits 'BaseComponent', and since it privately inherits it, you can't convert the pointers.

The fix is to publicly inherit it:
class TransformComponent : public BaseComponent

#1Servant of the Lord

Posted 28 December 2012 - 10:53 PM

I never encountered that error before! happy.png
 
Googling brought up this on the third hit. The first answer in that thread explains the error message.
 
Your code:
class TransformComponent : BaseComponent

...has 'TransformComponent' inherit 'BaseComponent', but didn't specify whether to inherit it publicly or privately. Private is default.

So 'TransformComponent' privately inherits 'BaseComponent', and since it privately inherits it, you can't convert the pointers.

The fix is to publicly inherit it:
class TransformComponent : public BaseComponent

PARTNERS