[Insight-users] Very strange link error while using vnl_Quaternion
Karthik Krishnan
Karthik.Krishnan at kitware.com
Tue Jul 26 14:26:59 EDT 2005
Di Xiao wrote:
> Dear all:
>
> I got a very strange link error while using vnl_Quaternion (coming
> with itk lib).
> While I use some function in vnl_Quaternion, like .size(),
> .normalize() or .real() etc., there is no link error. But while I use
> .angle(), .inverse() and .rotate() etc. functions, there will have
> undefined reference errors, as undefined reference to
> `vnl_quaternion<float>::operator*(vnl_quaternion<float> const&) const' .
>
vnl uses explicit template instantiation to deal with allowed types. See
Utilities/vxl/core/vnl/Templates contains the list of supported templates.
vnl_quaternion< double > is the only supported type.
About the linker errors:
The quaternion, derives from vnl_vector_fixed (of length 4) . The
methods normalize, size etc belong to the vnl_vector_fixed which is
explicitly instantiated over float and is ok. The methods "angle" etc
belong to the quaternion and you get a linker error.
I can't think of a good reason for representing quaternions in any data
type other than double, but if you can, I can add it the templates, so
it will get compiled into the vnl library.
> Any suggestion for solving it is welcomed.
>
> Thanks
>
> Xiao Di
>
> _________________________________________________________________
> Download MSN Messenger emoticons and display pictures.
> http://ilovemessenger.msn.com/?mkt=en-sg
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list