PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
10.03k stars 4.62k forks source link

[compile error] "error: no matching function for call to ‘vtkSmartPointer<vtkRenderWindow>::operator=(vtkRenderWindow*)’" #4207

Open jiapei100 opened 4 years ago

jiapei100 commented 4 years ago

Describe the error

[ 39%] Built target pcl_compute_cloud_error
make  -f tools/CMakeFiles/pcl_marching_cubes_reconstruction.dir/build.make tools/CMakeFiles/pcl_marching_cubes_reconstruction.dir/depend
make[2]: Entering directory '....../pcl/build_18.04'
cd ....../pcl/build_18.04 && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" ....../pcl ....../pcl/tools ....../pcl/build_18.04 ....../pcl/build_18.04/tools ....../pcl/build_18.04/tools/CMakeFiles/pcl_marching_cubes_reconstruction.dir/DependInfo.cmake --color=
Scanning dependencies of target pcl_marching_cubes_reconstruction
visualization/CMakeFiles/pcl_visualization.dir/build.make:137: recipe for target 'visualization/CMakeFiles/pcl_visualization.dir/src/histogram_visualizer.cpp.o' failed
make[2]: *** [visualization/CMakeFiles/pcl_visualization.dir/src/histogram_visualizer.cpp.o] Error 1
make  -f tools/CMakeFiles/pcl_gp3_surface.dir/build.make tools/CMakeFiles/pcl_gp3_surface.dir/depend
make[2]: Entering directory '....../pcl/build_18.04'
cd ....../pcl/build_18.04 && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" ....../pcl ....../pcl/tools ....../pcl/build_18.04 ....../pcl/build_18.04/tools ....../pcl/build_18.04/tools/CMakeFiles/pcl_gp3_surface.dir/DependInfo.cmake --color=
Scanning dependencies of target pcl_gp3_surface
In file included from /usr/local/include/pcl-1.11/pcl/visualization/pcl_visualizer.h:2347:0,
                 from /usr/local/include/pcl-1.11/pcl/visualization/cloud_viewer.h:39,
                 from ....../pcl/visualization/src/cloud_viewer.cpp:38:
/usr/local/include/pcl-1.11/pcl/visualization/impl/pcl_visualizer.hpp: In member function ‘bool pcl::visualization::PCLVisualizer::addPolygonMesh(const typename pcl::PointCloud<PointT>::ConstPtr&, const std::vector<pcl::Vertices>&, const string&, int)’:
/usr/local/include/pcl-1.11/pcl/visualization/impl/pcl_visualizer.hpp:1704:35: error: ‘class vtkCellArray’ has no member named ‘WritePointer’; did you mean ‘WeakPointers’?
     vtkIdType *cell = cell_array->WritePointer (vertices.size (), vertices.size () * (max_size_of_polygon + 1));
                                   ^~~~~~~~~~~~
                                   WeakPointers
/usr/local/include/pcl-1.11/pcl/visualization/impl/pcl_visualizer.hpp: In member function ‘bool pcl::visualization::PCLVisualizer::updatePolygonMesh(const typename pcl::PointCloud<PointT>::ConstPtr&, const std::vector<pcl::Vertices>&, const string&)’:
/usr/local/include/pcl-1.11/pcl/visualization/impl/pcl_visualizer.hpp:1881:28: error: ‘class vtkCellArray’ has no member named ‘WritePointer’; did you mean ‘WeakPointers’?
   vtkIdType *cell = cells->WritePointer (verts.size (), verts.size () * (max_size_of_polygon + 1));
                            ^~~~~~~~~~~~
                            WeakPointers
In file included from /usr/local/include/pcl-1.11/pcl/visualization/point_cloud_geometry_handlers.h:48:0,
                 from /usr/local/include/pcl-1.11/pcl/visualization/point_cloud_handlers.h:41,
                 from /usr/local/include/pcl-1.11/pcl/visualization/common/actor_map.h:41,
                 from /usr/local/include/pcl-1.11/pcl/visualization/pcl_visualizer.h:48,
                 from /usr/local/include/pcl-1.11/pcl/visualization/cloud_viewer.h:39,
                 from ....../pcl/visualization/src/cloud_viewer.cpp:38:
/usr/local/include/vtk-9.0/vtkSmartPointer.h: In instantiation of ‘vtkSmartPointer<ArrayType>& vtkSmartPointer<ArrayType>::operator=(const vtkSmartPointer<ArrayType>&) [with T = vtkRenderWindow]’:
/usr/local/include/pcl-1.11/pcl/visualization/interactor_style.h:364:18:   required from here
/usr/local/include/vtk-9.0/vtkSmartPointer.h:144:5: error: no matching function for call to ‘vtkSmartPointer<vtkRenderWindow>::operator=(vtkRenderWindow*)’
     this->vtkSmartPointerBase::operator=(r.GetPointer());
     ^~~~
In file included from /usr/local/include/vtk-9.0/vtkSmartPointer.h:26:0,
                 from /usr/local/include/pcl-1.11/pcl/visualization/point_cloud_geometry_handlers.h:48,
                 from /usr/local/include/pcl-1.11/pcl/visualization/point_cloud_handlers.h:41,
                 from /usr/local/include/pcl-1.11/pcl/visualization/common/actor_map.h:41,
                 from /usr/local/include/pcl-1.11/pcl/visualization/pcl_visualizer.h:48,
                 from /usr/local/include/pcl-1.11/pcl/visualization/cloud_viewer.h:39,
                 from ....../pcl/visualization/src/cloud_viewer.cpp:38:
/usr/local/include/vtk-9.0/vtkSmartPointerBase.h:70:24: note: candidate: vtkSmartPointerBase& vtkSmartPointerBase::operator=(vtkObjectBase*)
   vtkSmartPointerBase& operator=(vtkObjectBase* r);
                        ^~~~~~~~
/usr/local/include/vtk-9.0/vtkSmartPointerBase.h:70:24: note:   no known conversion for argument 1 from ‘vtkRenderWindow*’ to ‘vtkObjectBase*’
/usr/local/include/vtk-9.0/vtkSmartPointerBase.h:71:24: note: candidate: vtkSmartPointerBase& vtkSmartPointerBase::operator=(const vtkSmartPointerBase&)
   vtkSmartPointerBase& operator=(const vtkSmartPointerBase& r);
                        ^~~~~~~~
/usr/local/include/vtk-9.0/vtkSmartPointerBase.h:71:24: note:   no known conversion for argument 1 from ‘vtkRenderWindow*’ to ‘const vtkSmartPointerBase&’
In file included from /usr/local/include/pcl-1.11/pcl/visualization/point_cloud_geometry_handlers.h:48:0,
                 from /usr/local/include/pcl-1.11/pcl/visualization/point_cloud_handlers.h:41,
                 from /usr/local/include/pcl-1.11/pcl/visualization/common/actor_map.h:41,
                 from /usr/local/include/pcl-1.11/pcl/visualization/pcl_visualizer.h:48,
                 from /usr/local/include/pcl-1.11/pcl/visualization/cloud_viewer.h:39,
                 from ....../pcl/visualization/src/cloud_viewer.cpp:38:
/usr/local/include/vtk-9.0/vtkSmartPointer.h: In instantiation of ‘T* vtkSmartPointer<ArrayType>::GetPointer() const [with T = vtkRenderWindow]’:
/usr/local/include/vtk-9.0/vtkSmartPointer.h:144:44:   required from ‘vtkSmartPointer<ArrayType>& vtkSmartPointer<ArrayType>::operator=(const vtkSmartPointer<ArrayType>&) [with T = vtkRenderWindow]’
/usr/local/include/pcl-1.11/pcl/visualization/interactor_style.h:364:18:   required from here
/usr/local/include/vtk-9.0/vtkSmartPointer.h:188:43: error: invalid static_cast from type ‘vtkObjectBase* const’ to type ‘vtkRenderWindow*’
   T* GetPointer() const noexcept { return static_cast<T*>(this->Object); }
                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: Leaving directory '....../pcl/build_18.04'
make  -f tools/CMakeFiles/pcl_marching_cubes_reconstruction.dir/build.make tools/CMakeFiles/pcl_marching_cubes_reconstruction.dir/build
make[2]: Leaving directory '....../pcl/build_18.04'
make  -f tools/CMakeFiles/pcl_gp3_surface.dir/build.make tools/CMakeFiles/pcl_gp3_surface.dir/build
make[2]: Entering directory '....../pcl/build_18.04'

To Reproduce

Just cmake with most of the applications enabled.

Screenshots/Code snippets/Build information

N/A

Your Environment (please complete the following information):

If PCL was compiled from source or failure in compiling PCL itself:

Did anybody meet the same issue??

Cheers

larshg commented 4 years ago

Please try merge #4096 to your local checkout as VTK 9 is not supported yet, but work in progress. Would be nice if you can help validating that it's also working on ubuntu :smile: