##A.hh template void func(T t) {} template<> void func(int t) {} void func2(); ##A.cpp void func2() {} ##main.cpp func(\"hello\");
The problem is as follows: full template specialization is no more a template, it's more like an ordinary function. So you should act accordingly:
either put definition of func() in cpp file
func()
or make it inline