Re: Help with templates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks Eljay.

Yes, my main is located in mStackAr.cpp.

I solved the problem creating an Instancialization file, that only have the folowing lines:

#include "StackAr.cpp"
template class StackAr<int>;

But why do I have to include a .cpp? Cpp's aren't linked??? I am a C guy, that's a little confusing.

Ricardo

Eljay Love-Jensen wrote:

Hi Ricardo,

It looks like the main function does not have access to the template
declaration.

Is your template declaration in your StackAr.cpp?  Then you'll need #include
"StackAr.cpp" for your main, presuming main is located in mStackAr.cpp.

Or vice-versa, if I have StackAr.cpp and mStackAr.cpp reversed.

HTH,
--Eljay







[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux