[ITK] Compilation errors

Girish, Gavaskar Ruturaj gavaskar.ruturaj.girish at philips.com
Wed Jun 4 07:58:04 EDT 2014


Dear all,

I have written an ITK program which gives me errors when I try to compile it. I have copied a small sample of the errors below. All the other errors are similar.

c:\program files\itk\include\itk-4.6\itkImageSource.h(108): error C2039: 'RegionType' : is not a member of '`global namespace''
2>c:\program files\itk\include\itk-4.6\itkImageSource.h(108): error C2146: syntax error : missing ';' before identifier 'OutputImageRegionType'
2>c:\program files\itk\include\itk-4.6\itkImageSource.h(108): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\program files\itk\include\itk-4.6\itkImageSource.h(109): error C2825: 'itk::ImageSource<TOutputImage>::OutputImageType': must be a class or namespace when followed by '::'

c:\program files\itk\include\itk-4.6\itkImageSource.h(109): error C2039: 'PixelType' : is not a member of '`global namespace''
2>c:\program files\itk\include\itk-4.6\itkImageSource.h(109): error C2146: syntax error : missing ';' before identifier 'OutputImagePixelType'
2>c:\program files\itk\include\itk-4.6\itkImageSource.h(109): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2825: 'TOutputImage': must be a class or namespace when followed by '::'
2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2039: 'ImageDimension' : is not a member of '`global namespace''
2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2275: 'TOutputImage' : illegal use of this type as an expression
2>          c:\program files\itk\include\itk-4.6\itkImageToImageFilter.h(103) : see declaration of 'TOutputImage'
2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2146: syntax error : missing '}' before identifier 'ImageDimension'
2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2143: syntax error : missing ';' before '}'
2>c:\program files\itk\include\itk-4.6\itkImageToImageFilter.h(115): error C2039: 'OutputImageRegionType' : is not a member of 'itk::ImageSource<TOutputImage>'

When I searched on google, I found that this might happen if header files are included in the 'wrong' order. If it helps, I have included them in the following order:
#include               <iostream>
#include               "itkImage.h"
#include               "itkPoint.h"
#include               "itkIndex.h"
#include               "itkImageFileReader.h"
#include               "itkImageFileWriter.h"
#include               "itkMedianImageFilter.h"
#include               "itkThresholdImageFilter.h"
#include               "itkBinaryThresholdImageFilter.h"
#include               "itkBinaryFillholeImageFilter.h"
#include               "itkMaskImageFilter.h"
#include               "itkOtsuThresholdImageFilter.h"
#include               "itkAndImageFilter.h"
#include               "itkBinaryShapeOpeningImageFilter.h"
#include               "itkBinaryShapeKeepNObjectsImageFilter.h"
#include               "itkXorImageFilter.h"
#include               "itkConnectedComponentImageFilter.h"
#include               "itkLabelGeometryImageFilter.h"

I have created a separate header file in which I have included all the above header files and also all the typedef's for the filters. Can anybody give me an idea to why such errors may be occurring? I have not used a 'using namespace xxxx' anywhere.

Thanks & Regards,
Ruturaj

________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140604/958587d3/attachment.html>


More information about the Community mailing list