Do you include the header file in the cpp file? Do you compile the cpp file (not the h file)? Is formato also a template (it won't work if it's not a template or overloaded for the possible arguments).
What I'm doing bad? Maybe I cannot have templates with h and cpp??
Basically no, you cannot have template definitions in source (.cpp) files. This is in accordance with The Inclusion Model1. Move the template function definitions into the header file and give that a try.
1 I don't want to get into the different models at this time; just know that there are other (less popular) ways to deal with templates.