You have to put the entire definition of the template in the header file. The reason is the compiler basically creates a new function (in this case) with T replaced by the proper type, and to do that it needs the entire definition available when it hits line 13 in first.cpp and needs to make that replacement.
I see, thank you! Can you do something else to make it work? So that you only have the prototype (correct?) in the header and the definiton in the second.cpp file?