I would guess it is because the type for the template is not defined but, as Richard mentioned, there are so many undefined types in there that is difficult to know for sure. Personally, I see little reason to define standard variable types so I avoid doing that.
Anyway, to continue with my guessing, here is what I think your missing function declaration might look like :
typedef double & (* func)( VecDoub_O &x );
based on what the types of the data I see in your code.
If this is the case, I see little benefit to this being a template function and I really don't see why it is. If you were to change the type of data to float you would have a ton of errors and warnings and it would not compile so what other types do you anticipate using?
If I were you, I would define exactly what the type is for
func
that you will be using and I would drop the template aspect of the function so it is just a plain function that takes a pointer to a function as one of its arguments. Also, you need to be careful about returning a reference to insure the variable is valid when the function returns. For a simple data type you do not need to return a reference since it can live on the stack with no ill-effects.