Linker error with PCL recognition module in ros melodic
Hi,
While compiling the pcl object recognition code with ros, following error has occurred.
Tried out the same in PCL standalone, and it compiles successfully.
Platform: Ubuntu 18.04.3 LTS ; ros-melodic; perception_pcl pcl-1.8.1
Error:
CMakeFiles/object_recognition.dir/src/object_recognition.cpp.o: In function `cloud_callback(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&)':
object_recognition.cpp:(.text+0x23c5): undefined reference to `pcl::Hough3DGrouping<pcl::PointXYZRGBA, pcl::PointXYZRGBA, pcl::ReferenceFrame, pcl::ReferenceFrame>::recognize(std::vector<Eigen::Matrix<float, 4, 4, 0, 4, 4>, Eigen::aligned_allocator<Eigen::Matrix<float, 4, 4, 0, 4, 4> > >&, std::vector<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> >, std::allocator<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> > > >&)'
object_recognition.cpp:(.text+0x2560): undefined reference to `pcl::GeometricConsistencyGrouping<pcl::PointXYZRGBA, pcl::PointXYZRGBA>::recognize(std::vector<Eigen::Matrix<float, 4, 4, 0, 4, 4>, Eigen::aligned_allocator<Eigen::Matrix<float, 4, 4, 0, 4, 4> > >&, std::vector<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> >, std::allocator<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> > > >&)'
object_recognition.cpp:(.text+0x2f36): undefined reference to `pcl::GlobalHypothesesVerification<pcl::PointXYZRGBA, pcl::PointXYZRGBA>::verify()'
CMakeFiles/object_recognition.dir/src/object_recognition.cpp.o:(.data.rel.ro._ZTVN3pcl28GlobalHypothesesVerificationINS_12PointXYZRGBAES1_EE[_ZTVN3pcl28GlobalHypothesesVerificationINS_12PointXYZRGBAES1_EE]+0x10): undefined reference to `pcl::GlobalHypothesesVerification<pcl::PointXYZRGBA, pcl::PointXYZRGBA>::verify()'
CMakeFiles/object_recognition.dir/src/object_recognition.cpp.o:(.data.rel.ro._ZTVN3pcl28GeometricConsistencyGroupingINS_12PointXYZRGBAES1_EE[_ZTVN3pcl28GeometricConsistencyGroupingINS_12PointXYZRGBAES1_EE]+0x58): undefined reference to `pcl::GeometricConsistencyGrouping<pcl::PointXYZRGBA, pcl::PointXYZRGBA>::clusterCorrespondences(std::vector<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> >, std::allocator<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> > > >&)'
CMakeFiles/object_recognition.dir/src/object_recognition.cpp.o:(.data.rel.ro._ZTVN3pcl15Hough3DGroupingINS_12PointXYZRGBAES1_NS_14ReferenceFrameES2_EE[_ZTVN3pcl15Hough3DGroupingINS_12PointXYZRGBAES1_NS_14ReferenceFrameES2_EE]+0x58): undefined reference to `pcl::Hough3DGrouping<pcl::PointXYZRGBA, pcl::PointXYZRGBA, pcl::ReferenceFrame, pcl::ReferenceFrame>::clusterCorrespondences(std::vector<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> >, std::allocator<std::vector<pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> > > >&)'
collect2: error: ld returned 1 exit status
orbiton/pcl_pkgs/CMakeFiles/object_recognition.dir/build.make:310: recipe for target '/home/girishkumar/catkin_ws/devel/lib/pcl_pkgs/object_recognition' failed
make[2]: *** [/home/girishkumar/catkin_ws/devel/lib/pcl_pkgs/object_recognition] Error 1
CMakeFiles/Makefile2:13407: recipe for target 'orbiton/pcl_pkgs/CMakeFiles/object_recognition.dir/all' failed
make[1]: *** [orbiton/pcl_pkgs/CMakeFiles/object_recognition.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Do I need to add any component other than pcl_conversions, pcl_ros, roscpp, sensor_msgs.
Please Help.
Thank you.
Hi,
I also encountered the same problem, have you solved it?
Thank you.