[Insight-users] Any known template depth limitations with GCC 3.2?
Parag Chandra
pchandra@radonc.unc.edu
Thu, 10 Apr 2003 15:15:40 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_00EE_01C2FF74.0C142050
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I've derived a class from itkProcessObject that compiles just fine under =
MS VisualC++ 6. However, I'm getting a strange error from GCC on RedHat =
8.0 that claims the prototype for a method I've defined in my .txx file =
does not match the declaration in my .h file, even though the two are =
identical according to the compiler:
/mnt/development/aks/Code/Processing/aksContourIntersectionFilter.cxx:68:=
protot
ype
for `TInputImage::PixelType
=
aks::ContourIntersectionFilter<TInputImage>::DetermineCrossedContour(cons=
t
itk::ContinuousIndex<aks::ImageToPointSetFilter<TInputImage,
aks::PointsOfInterestSet<double, 2, 5, aks::POIMeshTraits<double, 2, =
5, 2,
double, double, double> > =
>::OutputPointSetType::PointType::CoordRepType,
aks::ContourIntersectionFilter<TInputImage>::InputImageDimension>&)' =
does
not match any in class `aks::ContourIntersectionFilter<TInputImage>'
/mnt/development/aks/Code/Processing/aksContourIntersectionFilter.h:107: =
candida
te
is: TInputImage::PixelType
=
aks::ContourIntersectionFilter<TInputImage>::DetermineCrossedContour(cons=
t
itk::ContinuousIndex<aks::ImageToPointSetFilter<TInputImage,
aks::PointsOfInterestSet<double, 2, 5, aks::POIMeshTraits<double, 2, =
5, 2,
double, double, double> > =
>::OutputPointSetType::PointType::CoordRepType,
aks::ContourIntersectionFilter<TInputImage>::InputImageDimension>&)
I cut and pasted the candidate and the prototype as reported above, and =
they are identical. In my code, they appear as:
InputImagePixelType DetermineCrossedContour(const ContinuousIndexType =
&index);
in the header, and as:
template <class TInputImage>
typename ContourIntersectionFilter<TInputImage>::InputImagePixelType=20
ContourIntersectionFilter<TInputImage>
::DetermineCrossedContour(const ContinuousIndexType &index)
in the source, where InputImagePixelType and ContinuousIndexType are =
defined as follows:
typedef typename itk::ContinuousIndex<OutputCoordRepType, =
InputImageDimension>=20
ContinuousIndexType;
typedef typename InputImageType::PixelType InputImagePixelType;
If I simply change the definition of ContinuousIndexType to:
typedef typename itk::ContinuousIndex<double, 2> =
ContinuousIndexType;
then the code compiles fine with GCC. Does anyone know what might be =
causing this? It seems like I'm running up against some ceiling on =
template depth.
Thanks.
-Parag Chandra
------=_NextPart_000_00EE_01C2FF74.0C142050
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1141" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I've derived a class from =
itkProcessObject that=20
compiles just fine under MS VisualC++ 6. However, I'm getting a strange =
error=20
from GCC on RedHat 8.0 that claims the prototype for a method I've =
defined in my=20
.txx file does not match the declaration in my .h file, even though the =
two are=20
identical according to the compiler:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2>/mnt/development/aks/Code/Processing/aksContourIntersectionFilte=
r.cxx:68:=20
protot<BR>ype<BR> for =
`TInputImage::PixelType<BR> =20
aks::ContourIntersectionFilter<TInputImage>::DetermineCrossedContou=
r(const<BR> =20
itk::ContinuousIndex<aks::ImageToPointSetFilter<TInputImage,<BR>&nb=
sp; =20
aks::PointsOfInterestSet<double, 2, 5, aks::POIMeshTraits<double, =
2, 5,=20
2,<BR> double, double, double> >=20
>::OutputPointSetType::PointType::CoordRepType,<BR> =20
aks::ContourIntersectionFilter<TInputImage>::InputImageDimension>=
;&)'=20
does<BR> not match any in class=20
`aks::ContourIntersectionFilter<TInputImage>'<BR>/mnt/development/a=
ks/Code/Processing/aksContourIntersectionFilter.h:107:=20
candida<BR>te<BR> is: =
TInputImage::PixelType<BR> =20
aks::ContourIntersectionFilter<TInputImage>::DetermineCrossedContou=
r(const<BR> =20
itk::ContinuousIndex<aks::ImageToPointSetFilter<TInputImage,<BR>&nb=
sp; =20
aks::PointsOfInterestSet<double, 2, 5, aks::POIMeshTraits<double, =
2, 5,=20
2,<BR> double, double, double> >=20
>::OutputPointSetType::PointType::CoordRepType,<BR> =20
aks::ContourIntersectionFilter<TInputImage>::InputImageDimension>=
;&)<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I cut and pasted the candidate and the =
prototype as=20
reported above, and they are identical. In my code, they appear =
as:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>InputImagePixelType =
DetermineCrossedContour(const=20
ContinuousIndexType &index);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>in the header, and as:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>template <class =
TInputImage><BR>typename=20
ContourIntersectionFilter<TInputImage>::InputImagePixelType=20
<BR>ContourIntersectionFilter<TInputImage><BR>::DetermineCrossedCon=
tour(const=20
ContinuousIndexType &index)<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in the source, where =
InputImagePixelType and=20
ContinuousIndexType are defined as follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> typedef typename=20
itk::ContinuousIndex<OutputCoordRepType, InputImageDimension>=20
<BR> =20
ContinuousIndexType;<BR></FONT><FONT face=3DArial =
size=3D2> =20
typedef typename InputImageType::PixelType =
InputImagePixelType;<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>If I simply change the definition of=20
ContinuousIndexType to:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> typedef typename=20
itk::ContinuousIndex<double, 2> ContinuousIndexType;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>then the code compiles fine with GCC. =
Does anyone=20
know what might be causing this? It seems like I'm running up against =
some=20
ceiling on template depth.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>-Parag Chandra</DIV>
<DIV><BR></DIV></FONT></BODY></HTML>
------=_NextPart_000_00EE_01C2FF74.0C142050--