[ITK] [ITK-users] vnl_numeric_traits.h constexpr _aka_ ITK and C++11

Matt McCormick matt.mccormick at kitware.com
Wed Apr 22 18:19:16 EDT 2015


Hi Pol,

Make sure to build ITK and everything that builds against ITK by
specifying the '-std=c++11' flag beginning with the initial CMake
configuration from a fresh build. By adding this flag, it is like
specifying a different compiler, and there are some initial
configuration try_compile tests that extract information about the
compiler.  Specify it with

  cmake -DCMAKE_CXX_FLAGS='std=c++11' ~/src/ITK

HTH,
Matt

On Wed, Apr 22, 2015 at 5:57 PM, Pol Monsó Purtí <lluna.nova at gmail.com> wrote:
> Hello all,
>
> Today I moved&updated the ITK directory so I had to rebuild everything. I am
> compiling with -std=c++11
>
> Misteriously, now I am getting the error
>
> /Users/monso/code/ITK/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_numeric_traits.h:437:68:
> error: 'constexpr' needed for in-class initialization of static data member
> 'const long double vnl_numeric_traits<long double>::maxval' of non-integral
> type [-fpermissive]
>    static const long double maxval
> VCL_STATIC_CONST_INIT_FLOAT_DECL(1.7976931348623157E+308);
>
> which apparently it's a bug that was there around 2011. How come it came
> back? Any ideas?
>
> This is using the master branch of
> https://github.com/InsightSoftwareConsortium/ITK.git
>
> See http://public.kitware.com/pipermail/community/2013-December/004580.html
>
> I am on OSX, using g++-mp-4.9
>
> I tried setting the vcl_include_cxx_0x, same result.
>
> I don't know how I fixed this or if I had the issue (I kind of recall this),
> but it worked before. So I tried with ITK4.7.1 from the website, same
> result.
>
> Cheers,
>
> Pol
>
>
> _____________________________________
> 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://www.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://public.kitware.com/mailman/listinfo/insight-users
>
_____________________________________
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://www.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://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list