hi,

i am trying to derive new classes from a template base class. I simplified my code as below just to
show the problem.

Qt Code:
  1. template<class T>
  2. class BaseClass
  3. {
  4. public:
  5. BaseClass(T&);
  6. private:
  7. };
  8.  
  9. //.cpp implementation
  10.  
  11. template<class T>
  12. BaseClass<T>::BaseClass<T>(T& iT)
  13. {
  14. }
To copy to clipboard, switch view to plain text mode 

and my derived class as:

Qt Code:
  1. class DerivedClass : public BaseClass<QString>
  2. {
  3. public:
  4. DerivedClass(QString);
  5. ~DerivedClass();
  6. private:
  7. };
  8.  
  9. //.cpp implementation
  10.  
  11. DerivedClass::DerivedClass(QString st)
  12. : BaseClass<QString>(st)
  13. {
  14. }
  15.  
  16. DerivedClass::~DerivedClass()
  17. {
  18. }
To copy to clipboard, switch view to plain text mode 

when i try to compile this code it gives link errors as below

DerivedClass.obj : error LNK2019: unresolved external symbol "public: __thiscall BaseClass<class QString>::BaseClass<class QString>(QString&)" (??0?$BaseClass@VQString@@@@QAE@XZ) referenced in function "public: __thiscall DerivedClass:erivedClass(QString)" (??0DerivedClass@@QAE@XZ)


it doesn't generate any error when i do not implement any constructor in the base class. and do not call the base constructor, but i want to implement some code in the base class' constructor.
so, what is the problem with this?

thanks