[Insight-developers] compilation error when compiled with gnu++0x flag
Bradley Lowekamp
blowekamp at mail.nih.gov
Wed May 9 08:43:34 EDT 2012
Yes, I think that is the reason. CMake try_compiles are done for that section of code. Essentially adding the -std=gnu++0x changes the compiler you are using to support a different language.
Brad
On May 9, 2012, at 8:36 AM, Arnaud Gelas wrote:
> Hi Brad,
>
> ITK was not compiled when I tried this...
> The only thing, I did is to configure once the project without the definitions, and a second time with the definitions.
>
> Could that be the reason?
>
> Thanks,
> Arnaud
>
> On 05/09/2012 02:31 PM, Bradley Lowekamp wrote:
>>
>> Hello Arnaud,
>>
>> Would this be after you compiled ITK with out this flag, and then had a project using ITK where this flag was added?
>>
>> Brad
>>
>>
>> On May 9, 2012, at 8:00 AM, Arnaud Gelas wrote:
>>
>>> Hi all,
>>>
>>> When doing cmake -DCMAKE_CXX_FLAGS=-std=gnu++0x /path/to/ITK && make
>>> -j8, I get compilation errors in vnl_math (see below).
>>>
>>> gcc version: 4.6.3
>>> cmake version: 2.8.7
>>>
>>> What would be the best way to fix these errors?
>>>
>>> Thanks,
>>> Arnaud
>>>
>>> ---
>>>
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:87:27:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘e’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:88:31:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘log2e’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:89:32:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘log10e’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:90:29:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘ln2’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:91:30:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘ln10’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:92:28:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘pi’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:93:35:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘pi_over_2’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:94:35:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘pi_over_4’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:95:37:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘one_over_pi’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:96:37:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘two_over_pi’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:97:41:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘two_over_sqrtpi’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:98:42:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘one_over_sqrt2pi’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:99:31:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘sqrt2’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:100:33:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘sqrt1_2’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:101:31:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘euler’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:104:29:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘eps’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:105:33:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘sqrteps’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:107:34:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘float_eps’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h:108:38:
>>> error: ‘constexpr’ needed for in-class initialization of static data
>>> member ‘float_sqrteps’ of non-integral type
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:84:24:
>>> error: ‘const double vnl_math::e’ is not a static member of ‘class vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:84:14:
>>> error: uninitialized const ‘vnl_math::e’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:85:24:
>>> error: ‘const double vnl_math::log2e’ is not a static member of ‘class
>>> vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:85:14:
>>> error: uninitialized const ‘vnl_math::log2e’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:86:24:
>>> error: ‘const double vnl_math::log10e’ is not a static member of ‘class
>>> vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:86:14:
>>> error: uninitialized const ‘vnl_math::log10e’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:87:24:
>>> error: ‘const double vnl_math::ln2’ is not a static member of ‘class
>>> vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:87:14:
>>> error: uninitialized const ‘vnl_math::ln2’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:88:24:
>>> error: ‘const double vnl_math::ln10’ is not a static member of ‘class
>>> vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:88:14:
>>> error: uninitialized const ‘vnl_math::ln10’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:89:24:
>>> error: ‘const double vnl_math::pi’ is not a static member of ‘class
>>> vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:89:14:
>>> error: uninitialized const ‘vnl_math::pi’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:90:24:
>>> error: ‘const double vnl_math::pi_over_2’ is not a static member of
>>> ‘class vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:90:14:
>>> error: uninitialized const ‘vnl_math::pi_over_2’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:91:24:
>>> error: ‘const double vnl_math::pi_over_4’ is not a static member of
>>> ‘class vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:91:14:
>>> error: uninitialized const ‘vnl_math::pi_over_4’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:92:24:
>>> error: ‘const double vnl_math::one_over_pi’ is not a static member of
>>> ‘class vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:92:14:
>>> error: uninitialized const ‘vnl_math::one_over_pi’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:93:24:
>>> error: ‘const double vnl_math::two_over_pi’ is not a static member of
>>> ‘class vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:93:14:
>>> error: uninitialized const ‘vnl_math::two_over_pi’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:94:24:
>>> error: ‘const double vnl_math::two_over_sqrtpi’ is not a static member
>>> of ‘class vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:94:14:
>>> error: uninitialized const ‘vnl_math::two_over_sqrtpi’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:95:24:
>>> error: ‘const double vnl_math::one_over_sqrt2pi’ is not a static member
>>> of ‘class vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:95:14:
>>> error: uninitialized const ‘vnl_math::one_over_sqrt2pi’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:96:24:
>>> error: ‘const double vnl_math::sqrt2’ is not a static member of ‘class
>>> vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:96:14:
>>> error: uninitialized const ‘vnl_math::sqrt2’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:97:24:
>>> error: ‘const double vnl_math::sqrt1_2’ is not a static member of ‘class
>>> vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:97:14:
>>> error: uninitialized const ‘vnl_math::sqrt1_2’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:98:24:
>>> error: ‘const double vnl_math::euler’ is not a static member of ‘class
>>> vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:98:14:
>>> error: uninitialized const ‘vnl_math::euler’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:101:24:
>>> error: ‘const double vnl_math::eps’ is not a static member of ‘class
>>> vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:101:14:
>>> error: uninitialized const ‘vnl_math::eps’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:102:24:
>>> error: ‘const double vnl_math::sqrteps’ is not a static member of ‘class
>>> vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:102:14:
>>> error: uninitialized const ‘vnl_math::sqrteps’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:105:23:
>>> error: ‘const float vnl_math::float_eps’ is not a static member of
>>> ‘class vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:105:13:
>>> error: uninitialized const ‘vnl_math::float_eps’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:106:23:
>>> error: ‘const float vnl_math::float_sqrteps’ is not a static member of
>>> ‘class vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:106:13:
>>> error: uninitialized const ‘vnl_math::float_sqrteps’ [-fpermissive]
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:
>>> In static member function ‘static double vnl_math::angle_0_to_2pi(double)’:
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:291:16:
>>> error: ‘pi’ is not a member of ‘vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:292:28:
>>> error: ‘pi’ is not a member of ‘vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:294:12:
>>> error: ‘pi’ is not a member of ‘vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:294:47:
>>> error: ‘pi’ is not a member of ‘vnl_math’
>>> /home/ajg23/DEVEL/src/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.cxx:304:21:
>>> error: ‘pi’ is not a member of ‘vnl_math’
>>> make[2]: ***
>>> [Modules/ThirdParty/VNL/src/vxl/core/vnl/CMakeFiles/itkvnl.dir/vnl_math.cxx.o]
>>> Error 1
>>> make[2]: *** Waiting for unfinished jobs....
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://kitware.com/products/protraining.php
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-developers
>>
>> ========================================================
>> Bradley Lowekamp
>> Medical Science and Computing for
>> Office of High Performance Computing and Communications
>> National Library of Medicine
>> blowekamp at mail.nih.gov
>>
>>
>>
>
========================================================
Bradley Lowekamp
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120509/5de69e3c/attachment-0001.htm>
More information about the Insight-developers
mailing list