|
-
September 23rd, 2009, 06:43 PM
#15
Re: multiple definition of a function
 Originally Posted by nikosft
The reason I want to include the inet.h in the exinet.h is because I want foo2 class to inherit foo class
You don't need a header file to inherit. How does "inheriting" any different than "declaring" in my sample code above? Where in C++ does it say "a header file is required..."? You can just take code straight out of any file and just copy it into your source module.
Once more, all a header file does for you is ease of use when declaring functions, classes, constants, so that you don't waste time doing it over and over again for each module, and that you won't make a mistake. That's all, nothing else. Nothing stops you from writing those declarations, constants, classes, etc. "by hand" in your own file.
Again, just copy that entire class defintion out of that header, and place it in the source code yourself.
The bottom line is this -- you must take the inet.h file, and use parts out of it by copying the lines from that file directly into your source code. If you say you can't include inet.h, well, don't include it.
Regards,
Paul McKenzie
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|