1

Initially, I had pcl-1.10 in /usr/(installed using sudo apt install libpcl-dev). Then I self-built pcl-1.12 in /usr/local/ for some reason. Now I uninstalled pcl-1.12 using sudo make uninstall and wanted to use the default pcl-1.10. But when I compiled my project, the error message showed

$ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
Starting >>> lidarslam_msgs
Starting >>> ndt_omp_ros2
--- stderr: ndt_omp_ros2                                                                           
make[2]: *** No rule to make target '/usr/local/lib/libpcl_surface.so', needed by 'align'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:80: CMakeFiles/align.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed   <<< ndt_omp_ros2 [0.16s, exited with code 2]

It seems that the PATH stills points to the /usr/local/lib even if I uninstalled the package. Is there a way I can reset PATH to the global package path? For this case, I believe the pcl-1.10's libpcl_surface.so is in /usr/lib/x86_64-linux-gnu/libpcl_outofcore.so .

I am working on ROS2 and compiling the CMakeList.txt using colcon. So I can't modify the makefile. I assume it is a PATH problem.

A way is to use symlink to link all the .so file in /usr/lib/x86_64-linux-gnu/ to /usr/local/lib but I found it kind of stupid...

yo930039
  • 11
  • 1
  • Try to clean the files generated by `cmake` or remove and re-create the whole build directory. Maybe see these answers: https://stackoverflow.com/q/9680420/10622916 – Bodo Feb 07 '23 at 18:13
  • Yes, it works after remove all build directory. Thanks, Bodo! – yo930039 Feb 07 '23 at 18:21

0 Answers0