prototype does not match any in class - maybe it should
Peter Cech
pcech@vision.ee.ethz.ch
Fri Nov 26 17:08:00 GMT 2004
Hi,
I got compiler error like this yesterday:
../src/PerSliceImageFilter.txx:79: error: prototype for `void
PerSliceImageFilter<TInputImage, TOutputImage>::SetOutputSlice(const
itk::Image<typename TOutputImage::PixelType,
(PerSliceImageFilter<TInputImage, TOutputImage>::OutputImageDimension -
1)>*, typename itk::ImageToImageFilter<TInputImage,
TOutputImage>::InputImageType::SizeValueType)' does not match any in class `
PerSliceImageFilter<TInputImage, TOutputImage>'
../src/PerSliceImageFilter.h:87: error: candidate is: void
PerSliceImageFilter<TInputImage, TOutputImage>::SetOutputSlice(const
itk::Image<typename TOutputImage::PixelType,
(PerSliceImageFilter<TInputImage, TOutputImage>::OutputImageDimension -
1)>*, typename itk::ImageToImageFilter<TInputImage,
TOutputImage>::InputImageType::SizeValueType)
../src/PerSliceImageFilter.txx:79: error: template definition of non-template `
void PerSliceImageFilter<TInputImage, TOutputImage>::SetOutputSlice(const
itk::Image<typename TOutputImage::PixelType,
(PerSliceImageFilter<TInputImage, TOutputImage>::OutputImageDimension -
1)>*, typename itk::ImageToImageFilter<TInputImage,
TOutputImage>::InputImageType::SizeValueType)'
However hard I look, both error and suggested methods are exactly the
same (there is only one SetOutputSlice in my class). Night sleep did not
help, they look the same this morning.
Preprocessed source can be downloaded from
http://www.vision.ee.ethz.ch/~pcech/bugreports/GCC-20041126/gcc-3.3.5-prototype_missed.ii
http://www.vision.ee.ethz.ch/~pcech/bugreports/GCC-20041126/gcc-3.3.5-prototype_missed.ii.gz
Compiler version is
gcc (GCC) 3.3.5 (Gentoo Linux 3.3.5, ssp-3.3.2-3, pie-8.7.6.7)
but I got the same error with 3.3.4 and 3.2.3. It seems that 3.4.3 is
not affected, but I'm not sure as it chokes on different place.
Is it bug in gcc or am I just doing something extremly stupid?
Regards,
Peter Cech
More information about the Gcc
mailing list