C++ Inheritance Problem with Allegro

Started by
3 comments, last by rip-off 12 years, 9 months ago
I am having an issue with inheritance. I want my "Monster" class to inherit from my "Sounds" class. In my "Monster" header i put

class Monster: public Sounds
{
.........
}


When I run the program I get the error "error C2504: 'Sounds': base class undefined."

The program runs fine if I don't try to inherit Sounds. I am using Microsoft Visual C++.
Advertisement
You need to include the header that contains the Sounds class before inheriting it in Monster.
You might want to reconsider your design, does it really make sense to use inheritance here (Is a Monster a Sound ?)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
<br />You need to include the header that contains the Sounds class before inheriting it in Monster.<br />
<br /><br /><br />

HOLY CRAP!!!! I can't believe I missed that. Thanks!

You might want to reconsider your design, does it really make sense to use inheritance here (Is a Monster a Sound ?)

QFE

This topic is closed to new replies.

Advertisement