ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Linking errors PCL

asked 2023-06-06 00:26:24 -0600

ALNA_Perera gravatar image

updated 2023-06-06 00:43:18 -0600

Hi,

I am trying to implement something like this: https://pcl.readthedocs.io/en/latest/... using lidar output.

I'm getting linking errors when trying to compile this.

colcon build --symlink-install 
Starting >>> cpp_tests
--- stderr: cpp_tests                             
** WARNING ** io features related to pcap will be disabled
/usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o: in function `pcl::Registration<pcl::PointXYZ, pcl::PointXYZ, float>::align(pcl::PointCloud<pcl::PointXYZ>&, Eigen::Matrix<float, 4, 4, 0, 4, 4> const&)':
ndt_transform_calculator.cpp:(.text._ZN3pcl12RegistrationINS_8PointXYZES1_fE5alignERNS_10PointCloudIS1_EERKN5Eigen6MatrixIfLi4ELi4ELi0ELi4ELi4EEE[_ZN3pcl12RegistrationINS_8PointXYZES1_fE5alignERNS_10PointCloudIS1_EERKN5Eigen6MatrixIfLi4ELi4ELi0ELi4ELi4EEE]+0x242): undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::setPointRepresentation(std::shared_ptr<pcl::PointRepresentation<pcl::PointXYZ> const> const&)'
/usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o: in function `pcl::Registration<pcl::PointXYZ, pcl::PointXYZ, float>::Registration()':
ndt_transform_calculator.cpp:(.text._ZN3pcl12RegistrationINS_8PointXYZES1_fEC2Ev[_ZN3pcl12RegistrationINS_8PointXYZES1_fEC5Ev]+0x69): undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/bin/ld: ndt_transform_calculator.cpp:(.text._ZN3pcl12RegistrationINS_8PointXYZES1_fEC2Ev[_ZN3pcl12RegistrationINS_8PointXYZES1_fEC5Ev]+0x98): undefined reference to `pcl::search::KdTree<pcl::PointXYZ, pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> > >::KdTree(bool)'
/usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o: in function `pcl::VoxelGridCovariance<pcl::PointXYZ>::VoxelGridCovariance()':
ndt_transform_calculator.cpp:(.text._ZN3pcl19VoxelGridCovarianceINS_8PointXYZEEC2Ev[_ZN3pcl19VoxelGridCovarianceINS_8PointXYZEEC5Ev]+0xe7): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::KdTreeFLANN(bool)'
/usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o: in function `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::~KdTreeFLANN()':
ndt_transform_calculator.cpp:(.text._ZN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEED2Ev[_ZN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEED5Ev]+0x26): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::cleanup()'
/usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o: in function `pcl::VoxelGridCovariance<pcl::PointXYZ>::filter(bool)':
ndt_transform_calculator.cpp:(.text._ZN3pcl19VoxelGridCovarianceINS_8PointXYZEE6filterEb[_ZN3pcl19VoxelGridCovarianceINS_8PointXYZEE6filterEb]+0x135): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(std::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, std::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o:(.data.rel.ro._ZTVN3pcl19VoxelGridCovarianceINS_8PointXYZEEE[_ZTVN3pcl19VoxelGridCovarianceINS_8PointXYZEEE]+0x48): undefined reference to `pcl::VoxelGridCovariance<pcl::PointXYZ>::applyFilter(pcl::PointCloud<pcl::PointXYZ>&)'
/usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o:(.data.rel.ro._ZTVN3pcl9VoxelGridINS_8PointXYZEEE[_ZTVN3pcl9VoxelGridINS_8PointXYZEEE]+0x48): undefined reference to `pcl::VoxelGrid<pcl::PointXYZ>::applyFilter(pcl::PointCloud<pcl::PointXYZ>&)'
/usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x10): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setInputCloud(std::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&, std::shared_ptr<std::vector<int, std::allocator<int> > const> const&)'
/usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x28): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::nearestKSearch(pcl::PointXYZ const&, unsigned int, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&) const'
/usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x40): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::radiusSearch(pcl::PointXYZ const&, double, std::vector<int, std::allocator<int> >&, std::vector<float, std::allocator<float> >&, unsigned int) const'
/usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o:(.data.rel.ro._ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE[_ZTVN3pcl11KdTreeFLANNINS_8PointXYZEN5flann9L2_SimpleIfEEEE]+0x58): undefined reference to `pcl::KdTreeFLANN<pcl::PointXYZ, flann::L2_Simple<float> >::setEpsilon(float)'
/usr/bin/ld: CMakeFiles/ndt_test.dir/src/ndt_transform_calculator.cpp.o: in function `pcl ...
(more)
edit retag flag offensive close merge delete

Comments

@ALNA_Perera Glad you resolved by yourself and thanks for sharing your resolution by updating your post.. Would you mind posting that as an answer, then mark it as "Answer" so that others can tell the question is resolved, and easily find the answer?

130s gravatar image 130s  ( 2023-06-06 09:33:49 -0600 )edit

I will do that. I'm still not sure why that worked though.

ALNA_Perera gravatar image ALNA_Perera  ( 2023-06-06 19:16:45 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-06 19:17:17 -0600

ALNA_Perera gravatar image

Solved it (?). Adding

target_link_libraries (ndt_test ${PCL_LIBRARIES} Eigen3::Eigen)

to cmake_lists solved the issue. I still don't know what the source of the problem is (basically, why not linking Eigen would cause problems with PCL).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-06-06 00:26:24 -0600

Seen: 415 times

Last updated: Jun 06 '23