[Insight-users] Linking problem integrating itktovtk example in vc++ 6 project
Luis Ibanez
luis . ibanez at kitware . com
Mon, 26 Aug 2002 11:40:06 -0400
Hi Martin,
The problem is that you declared the templated methods:
ConnectPipelines as members of the class CVtkItkConnector
but then defined them as plain templated functions.
(not as members of a class).
The linker is expecting to find the methods as:
CVtkItkConnector::ConnectPipelines(..etc.)
Please change your definition of the methods to include
the scope for the class and make clear to the compiler that
these are member methods of CVtkItkConnector.
Something like the code below will do it:
---------------------------
/**
* This function will connect the given itk::VTKImageExport filter to
* the given vtkImageImport filter.
*/
template <typename ITK_Exporter, typename VTK_Importer>
void
CVtkItkConnector:: // <---- This is what is missing
ConnectPipelines(ITK_Exporter exporter, VTK_Importer* importer)
{
//.....
}
-------------------
Note also that in your CVtkItkConnector class the types
of ITK image are already defined as Image<float,2>.
You may want to avoid the extra complication of having
templated members "ConnectPipelines" and just declare
it as a normal member method with the full specification
of the type of image to be used.
Please let us know if you find other problems
Thanks
Luis