Ask Your Question

Revision history [back]

Error on VTK; nullptr was not declared

I had an error when build. This is an error:

Scanning dependencies of target opencv_viz_pch_dephelp [ 31%] Building CXX object modules/viz/CMakeFiles/opencv_viz_pch_dephelp.dir/opencv_viz_pch_dephelp.cxx.o In file included from /usr/local/include/vtk-8.1/vtkGenericDataArray.h:72:0, from /usr/local/include/vtk-8.1/vtkAOSDataArrayTemplate.h:35, from /usr/local/include/vtk-8.1/vtkIntArray.h:33, from /usr/local/include/vtk-8.1/vtkCellTypes.h:42, from /usr/local/include/vtk-8.1/vtkPolyData.h:64, from /usr/local/include/vtk-8.1/vtkPolyDataAlgorithm.h:36, from /usr/local/include/vtk-8.1/vtkAppendPolyData.h:35, from /root/opencv/modules/viz/src/precomp.hpp:56, from /root/opencv/build/modules/viz/opencv_viz_pch_dephelp.cxx:1: /usr/local/include/vtk-8.1/vtkGenericDataArrayLookupHelper.h:72:5: warning: identifier ‘nullptr’ is a keyword in C++11 [-Wc++0x-compat] : AssociatedArray{nullptr}, SortedArray(nullptr), ^ /usr/local/include/vtk-8.1/vtkGenericDataArrayLookupHelper.h: In constructor ‘vtkGenericDataArrayLookupHelper<arraytypet>::vtkGenericDataArrayLookupHelper()’: /usr/local/include/vtk-8.1/vtkGenericDataArrayLookupHelper.h:72:22: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 : AssociatedArray{nullptr}, SortedArray(nullptr), ^ /usr/local/include/vtk-8.1/vtkGenericDataArrayLookupHelper.h:72:23: error: ‘nullptr’ was not declared in this scope : AssociatedArray{nullptr}, SortedArray(nullptr), ^ /usr/local/include/vtk-8.1/vtkGenericDataArrayLookupHelper.h:73:15: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 FirstValue{nullptr}, SortedArraySize{0} ^ /usr/local/include/vtk-8.1/vtkGenericDataArrayLookupHelper.h:73:41: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 FirstValue{nullptr}, SortedArraySize{0} ^ modules/viz/CMakeFiles/opencv_viz_pch_dephelp.dir/build.make:62: recipe for target 'modules/viz/CMakeFiles/opencv_viz_pch_dephelp.dir/opencv_viz_pch_dephelp.cxx.o' failed make[2]: * [modules/viz/CMakeFiles/opencv_viz_pch_dephelp.dir/opencv_viz_pch_dephelp.cxx.o] Error 1 CMakeFiles/Makefile2:5698: recipe for target 'modules/viz/CMakeFiles/opencv_viz_pch_dephelp.dir/all' failed make[1]: [modules/viz/CMakeFiles/opencv_viz_pch_dephelp.dir/all] Error 2 Makefile:160: recipe for target 'all' failed make: ** [all] Error 2

image description

I had no idea what is wrong. I'm using ubuntu 16.04, VTK 8.0, OpenCV 3.2 (Contrib version too), work on virtualenv