|
-
June 19th, 2012, 02:17 PM
#7
Re: generic inheritance
 Originally Posted by oteel
I doing what other doing I mean classmates))) If serious, I thinks main purpose of separating is that show new combination of pre processors... like including array.cpp in main not array.h like in class exercises
That is not how templates work, and that is the reason why you're getting a linker error.
One more time -- for template classes, all the code must be in one source file.
What you're doing is that you are separating NumericArray.cpp into its own module and compiling it. That is wrong. If anything, you would #include NumericArray.cpp within NumericArray.h.
Look at what you did with the Array class. Do you see how you #included "array.cpp"? So why didn't you do the same thing with NumericArray.h?
Regards,
Paul McKenzie
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
|