Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Optiamlly resolve user defined class used in header file (http://www.velocityreviews.com/forums/t752425-optiamlly-resolve-user-defined-class-used-in-header-file.html)

Ami 08-04-2011 07:45 AM

Optiamlly resolve user defined class used in header file
 
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.

Ian Collins 08-04-2011 08:02 AM

Re: Optiamlly resolve user defined class used in header file
 
On 08/ 4/11 07:45 PM, Ami wrote:
> 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?

--
Ian Collins


All times are GMT. The time now is 03:04 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.