When compiling a program that uses the following class, I get a tons of strange compilation errors about a undefined reference to `ZN8DebugLog5loglnIPKcEEvT'.
Yup, just discovered.
Thx anyway!
Not sure but I think this behaviour can be "resolved" by changing the compiling stage in the IDE.
Maybe by how the preprocessor looks up all the usages and writes a foo for each of them.
Because the compiler must instantiate the templated function into a real function with the actual data type substituted for the "T". It needs to do that when it's compiling the file where the function is invoked (eg the .ino file), not when it's compiling the .cpp file that holds the non-templated part of the class definition.
The only information that the compiler has when compiling the .ino is what's #include(d). That's the class's .h file so that's where the templated function definition needs to go.