I'm getting an undefined reference for this call:
Argonauts::Runtime::handleParseObject(m_val.m_type)
The handleParseObject function is defined in a header included by the file containing the above line like this (inside the Argonauts::Runtime
namespace):
template <typename Type> HandleParseAction handleParseObject(Type &) { return HandleParseAction("Unexpected value of type 'object'"); }
Overloads of function exist, this templated one should be a fallback for any type that does not have an overloaded variant.
The error message:
undefined reference to `Argonauts::Runtime::HandleParseAction Argonauts::Runtime::handleParseObject<SiteType>(SiteType&)'
Searching for help, both on SO and using Google is pretty much useless, since all results are from people who put the definition of the template function inside a source file.
I can get rid of the error by making the function static, but I feel uneasy about this. Is this the right way to do it or are there better ways?