Due to a weirdness in C++'s compilation model, you cannot separate out .h and .cpp files very cleanly for template classes. Specifically, any translation unit (C++ source file) that wants to use a template class has to have access to the entire template definition. This is a strange quirk of the language, but unfortunately it's here to stay.
One option is to put the implementation up in the header file rather than in the source, then to not have a .cpp file at all. For example, you might have this header:
#pragma once
#ifndef hijo_h
#define hijo_h
template
class hijo
{
public:
hijo(void);
~hijo(void);
};
/* * * * Implementation Below This Point * * * */
template
hijo::hijo(void)
{
}
template
hijo::~hijo(void)
{
}
#endif
Hope this helps!