I've got a problem with an undefined reference. I've set up a function template in one of my classes. The declaration is:
template <class T>
T IntegrateAB4(double delta_t, T& vLast, T* vLastArray);
The definition is:
template <class T>
T FGState::IntegrateAB4(double delta_t, T& vLast, T *vLastArray)
{
T vResult;
// Fourth order Adams-Bashforth integrator
vResult = (delta_t/24.0)*( 55.0 * vLast
- 59.0 * vLastArray[0]
+ 37.0 * vLastArray[1]
- 9.0 * vLastArray[2] );
vLastArray[2] = vLastArray[1];
vLastArray[1] = vLastArray[0];
vLastArray[0] = vLast;
return vResult;
}
I try and call this function from another class like this:
vUVW += State->IntegrateAB4(Tc, vUVWdot, vUVWdot_prev);
Everything compiles, but I get this error:
FGTranslation.o::FGTranslation.cpp: undefined reference to
`FGColumnVector3 FGState::IntegrateAB4<FGColumnVector3>(double,
FGColumnVector3 &, FGColumnVector3 *)'
I may abandon this approach, but I'd at least like to understand what the
problem is. I've got a hunch, but it's incomplete. :-)
Comments?
Jon
smime.p7s
Description: application/pkcs7-signature
