[Insight-developers] IRIX64-6.5-CC-n32-Continuous errors and CastImageFilter

Brad King brad . king at kitware . com
Mon, 5 Aug 2002 13:14:22 -0400 (EDT)


Brian,

> class is instantiated in the FEM landmark example.  The main error seems
> to be this one :
>
>  Explicit specialization of function
>
> "itk::fem::GenerateMesh<itk::fem::Element2DC0LinearQuadrilateral>::Re
>           ctangular" must precede its first use.
>   ::Rectangular(ElementType::ConstPointer e0, Solver& S, VectorType& orig,
> VectorType& size, VectorType& Nel)
>     ^
> which gives birth to a bunch of other problems.  I'm not sure what this
> means and we don't have these types of machines here.

The problem is that itkGenerateMesh.cxx defines specializations for the
Rectangular method.  However, this information is only available in the
.cxx, and not in the header file.  In Examples/FEM/FEMImageRegLMEx.cxx,
"itkFEMGenerateMesh.h" is included, but there is no way for the
compiler/linker to know that the symbol is defined as a specialization in
another translation unit.  The header needs to forward declare the
specializations.

In itkFEMGenerateMesh.h, just below the class definition of GenerateMesh,
but before closing the fem or itk namespaces, add these lines:

template<>
void
GenerateMesh<Element2DC0LinearQuadrilateral>
::Rectangular(ElementType::ConstPointer e0, Solver& S,
              VectorType& orig, VectorType& size,
              VectorType& Nel);

template<>
void
GenerateMesh<Element3DC0LinearHexahedron>
::Rectangular(ElementType::ConstPointer e0, Solver& S,
              VectorType& orig, VectorType& size,
              VectorType& Nel);

That should fix the problem.

-Brad