[Insight-developers] Compile error with vnl_vector_fixed.h from
ITK 2.2.0
Karthik Krishnan
Karthik.Krishnan at kitware.com
Tue Dec 20 11:48:21 EST 2005
To,
You definitely have SIZE multiply defined..
In otherwords you have some line like this in your code defined in the
global namespace.
#define SIZE 5
Please do not do that.. What's usually done is to prefix global typedefs
with application names as in #define VTK_SIZE 5
(Actually its a bad idea for vnl do do that since its classes are in the
global namespace.. but we can't change the VNL code)
Thanks
karthik
To Le wrote:
> Hi,
> Please help me to get over this. I try compile my code with ITK
> version < 2.2.0 It works fine. But with ITK version >= 2.2.0, the
> errors come from the vnl_vector_fixed.h file.
>
> In file included from
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_matrix_fixed.txx:15,
> from
> /usr/local/include/InsightToolkit_2.2.0/Common/itkImageBase.h:31,
> from
> /usr/local/include/InsightToolkit_2.2.0/Common/itkImage.h:20,
> from
> /usr/local/include/InsightToolkit_2.2.0/Common/itkImageToImageFilter.h:23,
> from
> /usr/local/include/InsightToolkit_2.2.0/Common/itkInPlaceImageFilter.h:23,
> from
> /usr/local/include/InsightToolkit_2.2.0/BasicFilters/itkUnaryFunctorImageFilter.h:20,
> from
> /usr/local/include/InsightToolkit_2.2.0/BasicFilters/itkCastImageFilter.h:20,
>
> ....
> usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:87:
> error: syntax
> error before numeric constant
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:87:
> error: missing
> ';' before right brace
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:89:
> error: syntax
> error before `protected'
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:102:
> error: `
> T' was not declared in this scope
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:102:
> error: `
> n' was not declared in this scope
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:102:
> error: template
> argument 1 is invalid
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:102:
> error: template
> argument 2 is invalid
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:103:
> error: ISO
> C++ forbids declaration of `vnl_vector_fixed' with no type
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:103:
> error: ISO
> C++ forbids declaration of `rhs' with no type
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:
> In
> function `int vnl_vector_fixed(const int&)':
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:103:
> error: `
> int vnl_vector_fixed(const int&)' redeclared as different kind of
> symbol
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_matrix_fixed.h:35:
> error: previous
> declaration of `template<class T, unsigned int n> class
> vnl_vector_fixed'
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_matrix_fixed.h:35:
> error: previous
> non-function declaration `template<class T, unsigned int n> class
> vnl_vector_fixed'
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:103:
> error: conflicts
> with function declaration `int vnl_vector_fixed(const int&)'
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:104:
> error: `
> data_' undeclared (first use this function)
> /usr/local/include/InsightToolkit_2.2.0/Utilities/vxl/core/vnl/vnl_vector_fixed.h:104:
> error: (Each
> undeclared identifier is reported only once for each function it
> appears
> Thank you very much in advance.
>
> To Le
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Insight-developers mailing list
>Insight-developers at itk.org
>http://www.itk.org/mailman/listinfo/insight-developers
>
>
More information about the Insight-developers
mailing list