Hello group,
I have a problem with template classes and inheritance. I've searched
on the internet to find a solution but all the examples look the same
as my code (as far as I can tell) and I can't find my mistake (maybe
there's something wrong with my eyes).
I've two classes:
template< class T >
class ITestTemplateA
{
public:
ITestTemplateA( ) { };
virtual ~ITestTemplateA () { };
};
template< class T >
class TestTemplateB : public ITestTemplateA< T >
{
public:
TestTemplateB() ;
virtual ~TestTemplateB( );
};
and the implementation of TestTemplateB:
template < class T>
TestTemplateB<T >::TestTemplate B()
{
}
template< class T >
TestTemplateB<T >::~TestTemplat eB()
{
}
Now I want to instantiate an object of type TestTemplateB:
TestTemplateB<I Track>* track = new TestTemplateB<I Track>();
Where ITrack is another class, but I think that the source-code to that
class isn't important (?). This compiles but the linker shows an error:
error LNK2001: unresolved external symbol "public: __thiscall
TestTemplateB<c lass ITrack>::TestTe mplateB<class ITrack>(void)"
(??0?$TestTempl ateB@VITrack@@@ @QAE@XZ)
Can somebody tell my what I'm doing wrong?
thanks in advance
Michael Doswald