Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Optiamlly resolve user defined class used in header file

Reply
Thread Tools

Optiamlly resolve user defined class used in header file

 
 
Ami
Guest
Posts: n/a
 
      08-04-2011
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.
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      08-04-2011
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Header files with "header.h" or <header.h> ?? mlt C++ 2 01-31-2009 02:54 PM
User-defined exception: "global name 'TestRunError' is not defined" jmike@alum.mit.edu Python 1 07-10-2008 12:37 PM
src-resolve: Cannot resolve the name ... ivanet@gmail.com XML 1 03-23-2007 12:10 PM
#if (defined(__STDC__) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) Oodini C Programming 1 09-27-2005 07:58 PM
How to resolve error LNK2005 - function already defined Angus Comber C Programming 1 01-08-2005 03:30 PM



Advertisments