In general, it means that the linker sees a reference to a symbol, but it can't find it anywhere - often due to a missing library or object file.
In this case this happened because you implemented your templated class'es member functions in a .cpp file - they should be implemented in the header.
A template class is a template not a class. When the compiler see you using e.g. vector<int> f;
it creates a new class vector<int>
from the template vector
. In order to create e.g. vector<int>::size()
it needs to see the implementation of size()
at the point where the template is instantiated - and it can't do that if the implementation of size()
isn't in the header file.
You can get around this by explicitly instantiating vector
for int
- Then the compiler will see the explicit instantiation when it compiles the cpp file. This defeats the purpose of having a template - it'd only be usable for the types you predefine with explicit instantiation. So, short story, always fully implement templates in header files.