|
-
Apr 15th, 2002, 11:50 AM
#1
redefinition?!
I have two template classes and a regular class.
For simplicity: TClass1, TClass2, and Class3(.h and .cpp).
TClass2 inherites TClass1. In TClass2 I have #include "TClass1.h" And then in Class3, I #include "TClass2.h". Then once in my main.cpp I #include both "Class3.h" and "TClass2.h". Then when I compile I get a redefinition error, saying the class in TClass1 has already been redefined.
Error:
h:\cs131\assignment 3\grid.h(26) : error C2953: 'grid' : template class has already been defined
(grid is the class in TClass1)
What can I do? I need to use both TClass2 and Class3 in main. And Class3 needs to use TClass2 data type (constructor and 2 public functions).
Anyone even know what I'm talking about?!
NOMAD
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
|