Optiamlly resolve user defined class used in header file

A

Ami

Hi All,
I have a header file(my_derived.h) in which I derive a class from another user defined class which exists in another header file (my_base.h). Is it possible to avoid including my_base.h in my_derived.h and still can resolve the reference?
My intention is to keep my_derived.h free of any include<> s.
When I include my_base.h in my_derived.cpp, I get
error C2504: 'my_base_class' : base class undefined

I am using Visual studio 2010 as IDE.
Any better suggestion to keep header files clean are highly appreciated.
Thanks in advance.
 
I

Ian Collins

Hi All,
I have a header file(my_derived.h) in which I derive a class from another user defined class which exists in another header file (my_base.h). Is it possible to avoid including my_base.h in my_derived.h and still can resolve the reference?
No.

My intention is to keep my_derived.h free of any include<> s.

Why?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top