[ITK] ITK: error: floating-point literal cannot appear in a constant-expression

Bradley Lowekamp blowekamp at mail.nih.gov
Tue Jul 29 17:20:34 EDT 2014


Hello,

Is any of your code monkeying around with the "-std=c++11" flags? Did you compile ITK or your application with it?

Brad

On Jul 29, 2014, at 10:59 AM, Nick Patterson <pattersonnp.work at gmail.com> wrote:

> Hi,
>   Can I ask if anybody has the following error when compiling code which makes use of ITK? The complilation of ITK was fine, this is an error produced when compiling against ITK in my own application.
> 
> The error that I am currently getting is:- (Building on Ubuntu Linux). 
> 
> 
> In file included from /usr/local/include/ITK-4.5/vnl/vnl_c_vector.h:26:0,
>                 from /usr/local/include/ITK-4.5/vnl/vnl_vector.h:22,
>                 from /usr/local/include/ITK-4.5/vnl/vnl_vector_ref.h:20,
>                 from /usr/local/include/ITK-4.5/itkVector.h:23,
>                 from /usr/local/include/ITK-4.5/itkPoint.h:23,
>                 from /usr/local/include/ITK-4.5/itkContinuousIndex.h:21,
>                 from /usr/local/include/ITK-4.5/itkImageRegion.h:34,
>                 from /usr/local/include/ITK-4.5/itkImageIORegion.h:24,
>                 from /usr/local/include/ITK-4.5/itkImageIOBase.h:26,
>                 from /usr/local/include/ITK-4.5/itkImageFileReader.h:22,
>                 from /usr/local/include/ITK-4.5/itkImageSeriesReader.h:26,
>                 from /home/nppatt/Raydose2/RaydoseNew/src/Simulation/RaydoseNMImageData.cpp:2:
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:387:27: error: floating-point literal cannot appear in a constant-expression
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:387:27: warning: ISO C++ forbids initialization of member constant 'zero' of non-integral type 'const float' [-pedantic]
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:389:26: error: floating-point literal cannot appear in a constant-expression
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:389:26: warning: ISO C++ forbids initialization of member constant 'one' of non-integral type 'const float' [-pedantic]
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:391:29: error: floating-point literal cannot appear in a constant-expression
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:391:29: warning: ISO C++ forbids initialization of member constant 'maxval' of non-integral type 'const float' [-pedantic]
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:410:28: error: floating-point literal cannot appear in a constant-expression
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:410:28: warning: ISO C++ forbids initialization of member constant 'zero' of non-integral type 'const double' [-pedantic]
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:412:27: error: floating-point literal cannot appear in a constant-expression
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:412:27: warning: ISO C++ forbids initialization of member constant 'one' of non-integral type 'const double' [-pedantic]
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:414:30: error: floating-point literal cannot appear in a constant-expression
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:414:30: warning: ISO C++ forbids initialization of member constant 'maxval' of non-integral type 'const double' [-pedantic]
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:433:33: error: floating-point literal cannot appear in a constant-expression
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:433:33: warning: ISO C++ forbids initialization of member constant 'zero' of non-integral type 'const long double' [-pedantic]
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:435:32: error: floating-point literal cannot appear in a constant-expression
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:435:32: warning: ISO C++ forbids initialization of member constant 'one' of non-integral type 'const long double' [-pedantic]
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:437:35: error: floating-point literal cannot appear in a constant-expression
> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:437:35: warning: ISO C++ forbids initialization of member constant 'maxval' of non-integral type 'const long double' [-pedantic]R
> 
> 
> Regards, Nick
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community




More information about the Community mailing list