Just move the line
template<> const p3df p3df::origin(0.0f);
before the main()
function, but after the typedef
.
I am really not sure what the problem is here. It seems like clang complains that you're providing a definition for the template specialization after using said specialization. gcc/4.9 (nightly build) does not have an issue with it.
Generally speaking, having a static template definition in a header file is cool, since they are - as the name implies - templates. However, if you specialize your template, thereby making it an actual class, the one definition rule applies as to any regular class, and you need to move the definition to a non-header file.