PointCloudLibrary / pcl

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

Within a new project, this compile process has a bug in two header files (type_traits.h and point_struct_traits.h). #6057

Closed piluohong closed 3 weeks ago

piluohong commented 1 month ago

error: redefinition of ‘struct pcl::traits::decomposeArray’ 68 | template struct decomposeArray; These two header files (type_traits.h and point_struct_traits.h) are conficted.

mvieth commented 1 month ago

@piluohong

mvieth commented 3 weeks ago

@piluohong If you don't reply soon, I will close this issue. In PCL 1.11.0, decomposeArray is defined in type_traits.h. Since PCL 1.11.1, decomposeArray is defined in point_struct_traits.h. There is no PCL version where it is defined in both headers. My best guess is that you have multiple PCL versions installed.

piluohong commented 3 weeks ago

Sorry for not checking it in time. I've had this happen to both ubuntu18.04 and ubuntu20.04, where ubuntu18.04 has multiple versions, but I isolated them when I linked. ubuntu20.04 is the PCL that only comes with ROS noetic. Then I installed PCL1.14.0 version and this kind of problem also appeared. The project I compiled is Coco-LIC, which is available on github. Sorry again for not checking your reply in time, thank you for your kind answer

piluohong commented 3 weeks ago

This is in ubuntu 20.04. ROS's PCL is 1.10. I install PCL 1.14.0 by source code. Then /usr/local/include/pcl-1.14/pcl/type_traits.h:103:23: error: redefinition of ‘struct pcl::traits::asType<2>’ 103 | template<> struct asType { using type = std::uint8_t; }; | ^~~~~~~~~~