class derived from template class

From: Corey Wirun (corey.wirun_at_nospam.ca)
Date: 07/31/04


Date: Fri, 30 Jul 2004 22:43:04 GMT

Hi All,

I've got a template class:

template < typename T >
class A: public B
{
public:
  A();
  virtual ~A();
  virtual void PreSubclassWindow();
  virtual void DefineColumns( int i ) = 0;
  ...
}

And I want to derive a class from 'A' called 'Derived':

class Derived: public A< DataClass >
{
  Derived();
  virtual ~Derived();
}

The problem is that when I link (VS.Net 2002, unmanaged), I get 'unsolved
symbols' for the constructor and all virtuals for the base class 'A', in the
derived class' object code.

e.g.
B.obj: unresolved external symbol "protected: virtual void __thiscall
A<class DataClass>::PreSubclassWindow(void)"
(?PreSubclassWindow@?$A@VDataClass@@@@MAEXXZ)

Does anyone know why this occurs? Is there something extra I have to do
syntactically to get it to work?

Thanks all!
C.



Relevant Pages

  • Re: MFC Shared DLL
    ... LNK2001: unresolved external symbol __afxForceSTDAFX ... LNK2001: unresolved external symbol "protected: virtual void __cdecl ...
    (microsoft.public.windowsce.platbuilder)
  • Link error LNK2001
    ... virtual void __thiscall GroupUser::SetExpiration(class ... EnhanceFiles.obj: error LNK2001: unresolved external symbol "public: ... virtual bool __thiscall GroupUser::IsAdminGroup" ...
    (microsoft.public.vc.mfc)
  • CEdit PreSubclassWindow Problem
    ... class CMyEdit: public CEdit ... virtual void PreSubclassWindow(); ...
    (microsoft.public.vc.mfc)