Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi,

I trying to shift from c to c++ for BREW development. Right now I am using forward declaration of class(say A) whose data member I want to use in this class(say B ) and then declaring pointer to that in B class allocates memory with new
and then access public data members of A through this pointer .

All works well upto here but I am not able to use Inheritance concept in my program ,
whenever I tries to use Inheritance I get the message Base class is not defined though it works well when I uses Forward declaration for the same.

Any reply will be helpful to make progress in C++.

Thanks.

Are you trying to inherit class A in class B like this
class B: public A
{
.....

or just having a data member of type class A in class B.
class B
{
A objectA;
...

Whatever the case, the header file(.h) of class A should be included in the header file of class B.

Are you trying to inherit class A in class B like this
class B: public A
{
.....

or just having a data member of type class A in class B.
class B
{
A objectA;
...

Whatever the case, the header file(.h) of class A should be included in the header file of class B.

Hi,
I did included all required files but tell me , if I am wrong
I feel we will not be able to provide multiple inheritance on class which extends AEEApplet
eg,
class A : public AEEApplet, B
Thanks for uor prev reply.
Ashutosh

Hi,
I did included all required files but tell me , if I am wrong
I feel we will not be able to provide multiple inheritance on class which extends AEEApplet
eg,
class A : public AEEApplet, B
Thanks for uor prev reply.
Ashutosh

If you are getting the error message "Base class is not defined" then you are definitely missing an include of a header file.
If you're going to use multiple inheritance, make sure you understand
http://en.wikipedia.org/wiki/Virtual_table
and static_cast versus reinterpret_cast

If you are getting the error message "Base class is not defined" then you are definitely missing an include of a header file.
If you're going to use multiple inheritance, make sure you understand
http://en.wikipedia.org/wiki/Virtual_table
and static_cast versus reinterpret_cast