[vtk-developers] Errors when compiling VTK v6.0.0 in C++11 mode

Kevin Funk kevin.funk at kdab.com
Wed Jul 10 11:28:00 EDT 2013


On Wednesday 10 July 2013, 11:08, Kyle Lutz wrote:
> On Wed, Jul 10, 2013 at 10:31 AM, Kevin Funk <kevin.funk at kdab.com> wrote:
> > Hey list,
> > 
> > Compiling VTK v6.0.0 with C++11 mode enabled results in the following
> > compilation error:
> > 
> > """
> > [ 26%] Building CXX object
> > Common/Core/CMakeFiles/vtkCommonCore.dir/vtkAbstractArray.cxx.o
> > In file included from /home/krf/devel/src/VTK-
> > master/Common/Core/vtkAbstractArray.cxx:26:0:
> > /home/krf/devel/src/VTK-master/Common/Core/vtkMath.h: In static member
> > function 'static int vtkMath::IsInf(double)':
> > /home/krf/devel/src/VTK-master/Common/Core/vtkMath.h:1249:18: error: call
> > of overloaded 'isinf(double&)' is ambiguous
> > /home/krf/devel/src/VTK-master/Common/Core/vtkMath.h:1249:18: note:
> > candidates are:
> > In file included from /usr/include/math.h:70:0,
> > 
> >                  from /home/krf/devel/src/VTK-
> > 
> > master/Common/Core/vtkSetGet.h:30,
> > 
> >                  from /home/krf/devel/src/VTK-
> > 
> > master/Common/Core/vtkObject.h:43,
> > 
> >                  from /home/krf/devel/src/VTK-
> > 
> > master/Common/Core/vtkAbstractArray.h:45,
> > 
> >                  from /home/krf/devel/src/VTK-
> > 
> > master/Common/Core/vtkAbstractArray.cxx:15:
> > /usr/include/x86_64-linux-gnu/bits/mathcalls.h:202:12: note: int
> > isinf(double) In file included from /home/krf/devel/build/VTK-
> > master/Common/Core/vtkMathConfigure.h:24:0,
> > 
> >                  from
> >                  /home/krf/devel/src/VTK-master/Common/Core/vtkMath.h:42,
> >                  from /home/krf/devel/src/VTK-
> > 
> > master/Common/Core/vtkAbstractArray.cxx:26:
> > /usr/include/c++/4.7/cmath:611:3: note: constexpr bool std::isinf(long
> > double) /usr/include/c++/4.7/cmath:607:3: note: constexpr bool
> > std::isinf(double) /usr/include/c++/4.7/cmath:603:3: note: constexpr bool
> > std::isinf(float) In file included from /home/krf/devel/src/VTK-
> > master/Common/Core/vtkAbstractArray.cxx:26:0:
> > /home/krf/devel/src/VTK-master/Common/Core/vtkMath.h: In static member
> > function 'static int vtkMath::IsNan(double)':
> > /home/krf/devel/src/VTK-master/Common/Core/vtkMath.h:1259:18: error: call
> > of overloaded 'isnan(double&)' is ambiguous
> > /home/krf/devel/src/VTK-master/Common/Core/vtkMath.h:1259:18: note:
> > candidates are:
> > In file included from /usr/include/math.h:70:0,
> > 
> >                  from /home/krf/devel/src/VTK-
> > 
> > master/Common/Core/vtkSetGet.h:30,
> > 
> >                  from /home/krf/devel/src/VTK-
> > 
> > master/Common/Core/vtkObject.h:43,
> > 
> >                  from /home/krf/devel/src/VTK-
> > 
> > master/Common/Core/vtkAbstractArray.h:45,
> > 
> >                  from /home/krf/devel/src/VTK-
> > 
> > master/Common/Core/vtkAbstractArray.cxx:15:
> > /usr/include/x86_64-linux-gnu/bits/mathcalls.h:235:12: note: int
> > isnan(double) In file included from /home/krf/devel/build/VTK-
> > master/Common/Core/vtkMathConfigure.h:24:0,
> > 
> >                  from
> >                  /home/krf/devel/src/VTK-master/Common/Core/vtkMath.h:42,
> >                  from /home/krf/devel/src/VTK-
> > 
> > master/Common/Core/vtkAbstractArray.cxx:26:
> > /usr/include/c++/4.7/cmath:629:3: note: constexpr bool std::isnan(long
> > double) /usr/include/c++/4.7/cmath:625:3: note: constexpr bool
> > std::isnan(double) /usr/include/c++/4.7/cmath:621:3: note: constexpr bool
> > std::isnan(float) make[2]: ***
> > [Common/Core/CMakeFiles/vtkCommonCore.dir/vtkAbstractArray.cxx.o] Error 1
> > make[1]: *** [Common/Core/CMakeFiles/vtkCommonCore.dir/all] Error 2
> > make: *** [all] Error 2
> > makeobj[0]: Leaving directory `/home/krf/devel/build/VTK-master'
> > """
> > 
> > Since there are C++11 checks all over the code base I'd assume one can
> > compile VTK in C++11 mode.
> > 
> > Is that a known issue? I didn't find a bug report for this one.
> 
> Hi Kevin,
> 
> This is indeed a bug. Feel free to create an issue on the bug tracker.
> Attached is an (untested) patch which should fix the issue. Can you
> try it out?
> 
> Sean, can you take a look at this?
> 
> Thanks,
> Kyle

Thanks, I've created a bug report [1].

I got exactly the same patch locally -- I'll send a review request to Gerrit.

Thanks.

[1] http://www.vtk.org/Bug/view.php?id=14164

-- 
Join us in October at Qt Developer Days 2013! - https://devdays.kdab.com

Kevin Funk | kevin.funk at kdab.com | Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solution



More information about the vtk-developers mailing list