[ITK Community] ITK with -std=c++11

Matt McCormick matt.mccormick at kitware.com
Thu Dec 19 13:34:26 EST 2013


Hi Garjola,

> Just a quick wrap-up of the set-up which works OK for me.

Thanks for the report.

>
> - I am using gcc 4.7.2 (debian stable package) instead of the hand-compiled 4.8.2
> - ITK builds OK with -std=c++11 and does not need -fpermissive
> - My external project using vnl_numeric_traits needs to be built with BOTH -std=c++11 and -fpermissive.

Yes, all code that is linked together in a C++ application should be
(needs to be) compiled with the same "-std" flag.

> I hope this helps and sorry for bothering.

Thanks for the message and your activity on the list.

Matt

>
> Garjola.
>
> Garjola <garjola at garjola.net> wrote:
>>
>> Garjola <garjola at garjola.net> wrote:
>>>
>>> Matt McCormick <matt.mccormick at kitware.com> wrote:
>>>>
>>>> Hi Garjola,
>>>>
>>>> What version of ITK?
>>>>
>>>
>>> I am using 4.4.2.
>>>
>>> In the meantime, I found this:
>>>
>>> //Enable C++0x standard extensions
>>> VCL_INCLUDE_CXX_0X:BOOL=ON
>>>
>>> But the build is still going on.
>>>
>>
>> Well, it made no difference.
>>
>> I am aware of patches that were needed for gcc 4.6 (circa 2011), but I am assuming that this has been solved since.
>>
>> Any hint is welcome.
>>
>> Thanks again.
>>
>> Garjola
>>
>>> Thanks.
>>>
>>> Garjola.
>>>
>>>> Thanks,
>>>> Matt
>>>>
>>>>
>>>> On Wed, Dec 18, 2013 at 5:22 PM, Garjola <garjola at garjola.net> wrote:
>>>>> Dear all,
>>>>>
>>>>> I have been trying to build ITK with gcc 4.8.2 and using -std=c++11. I succeeded with the compile step (I had to add -fpermissive) but now I am having errors when using some vnl classes.
>>>>>
>>>>> The errors are related to missing 'constexpr':
>>>>>
>>>>> Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_numeric_traits.h:387:60:
>>>>> error: ‘constexpr’ needed for in-class initialization of static data
>>>>> member ‘const float vnl_numeric_traits<float>::zero’ of non-integral
>>>>> type [-fpermissive]
>>>>>    static const float zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0F);
>>>>>
>>>>> Has anybody met this kind of error and is there any workaround?
>>>>>
>>>>> Thank you.
>>>>>
>>>>> Garjola.
>>>>>
>>>>> --
>>>>> Dr. Dindi
>>>>> Dad, Philosopher, Hacker
>>>>> _______________________________________________
>>>>> Community mailing list
>>>>> Community at itk.org
>>>>> http://public.kitware.com/cgi-bin/mailman/listinfo/community
> --
> Dr. Dindi
> Dad, Philosopher, Hacker
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community



More information about the Community mailing list