I have a template (non-member) function that is declared inside a namespace in an hpp file and defined in a cpp file. It is compiled, and the corresponding o file is sent to the linker OK. My main.cpp includes the relevant hpp file. But I still get an "undefined reference" error to the function when I try to call it from main(). I'm stumped. What could be wrong?