I've a simple problem but I really can't understand why. I think you can help me.
I have a template base class :
template <class T> class Base
{
public:
T foo(T t);
protected:
Base();
~Base();
};
I want to derive a specialisation of this template :
class Derived : public Base<std::string>
{
public:
Derived();
virtual ~Derived();
};
All the functions are defined in the respective .cpp (they are empty, except for foo which just returns t)
I chose std::string as an example. But this simple code doesn't compile. I have errors : "indefinite reference to "Base::Base()" "indefinite reference to "Base::~Base()"
It seems that I follow examples on internet but it doesn't work... I really don't understand this one, it must be obvious!
Can you help me? :)
(PS : sorry if my english is bad)