/home/wanhang/pcl-pcl-1.8.1/io/src/vtk_lib_io.cpp:363:14: error: redeclaration of ‘vtkIdType* cell_points’ vtkIdType* cell_points; // 将 cell_points 声明为指向非const的类型 ^~~~~~~~~~~ /home/wanhang/pcl-pcl-1.8.1/io/src/vtk_lib_io.cpp:358:14: note: ‘vtkIdType* cell_points’ previously declared here vtkIdType* cell_points; ^~~~~~~~~~~ /home/wanhang/pcl-pcl-1.8.1/io/src/vtk_lib_io.cpp:365:54: error: cannot bind non-const lvalue reference of type ‘const vtkIdType*&’ {aka ‘const long long int*&’} to an rvalue of type ‘const vtkIdType*’ {aka ‘const long long int*’} while (mesh_polygons->GetNextCell (nr_cell_points, cell_points)) ^~~~~~~~~~~ In file included from /home/wanhang/pcl-pcl-1.8.1/io/include/pcl/io/vtk_lib_io.h:62, from /home/wanhang/pcl-pcl-1.8.1/io/src/vtk_lib_io.cpp:38: /home/wanhang/anaconda3/envs/python38/include/vtk-9.0/vtkCellArray.h:1419:12: note: initializing argument 2 of ‘int vtkCellArray::GetNextCell(vtkIdType&, const vtkIdType*&)’ inline int vtkCellArray::GetNextCell(vtkIdType& npts, vtkIdType const*& pts) VTK_SIZEHINT(pts, npts) ^~~~~~~~~~~~ make[2]: *** [io/CMakeFiles/pcl_io.dir/build.make:328: io/CMakeFiles/pcl_io.dir/src/vtk_lib_io.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:1003: io/CMakeFiles/pcl_io.dir/all] Error 2 make: *** [Makefile:166: all] Error 2
时间: 2023-08-17 10:05:12 浏览: 240
这是一个编译错误,提示vtk_lib_io.cpp文件中有一个变量cell_points被重复声明了,而且在后面的代码中还有一个引用该变量的错误。建议检查一下vtk_lib_io.cpp文件中的变量声明和引用是否正确,特别是是否有重复声明或者未定义的变量。另外,也可以检查一下编译器的版本是否支持vtkCellArray::GetNextCell函数的调用。
阅读全文