/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 21:05:12 浏览: 247
这个错误提示中,重点是第三行的错误信息: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*’}。这个错误通常是由于函数参数类型不匹配导致的。建议检查一下代码中调用vtkCellArray::GetNextCell函数的参数类型是否正确匹配。如果类型匹配正确,可以尝试更新对应的库文件或者重新编译该库。
阅读全文