PCL1.7和1.8版本冲突问题

同事的点云程序必须用PCL-1.8,而ROS默认的是1.7,结果有时出现了版本冲突。

安装了PCL-1.8后,重要的库文件libcostmap_2d.so链接到了pcl-1.8,而不是默认的1.7。此时删除了pcl-1.8之后,再编译会报错:

1
2
3
4
CMake Error at /home/user/catkin_ws/devel/share/costmap_2d/cmake/costmap_2dConfig.cmake:113 (message):
Project 'costmap_2d' specifies '/usr/local/include/pcl-1.8' as an include
dir, which is not found. It does neither exist as an absolute directory
nor in '/home/user/catkin_ws/src/navigation/costmap_2d//usr/local/include/pcl-1.8'.

编译还会找pcl-1.8的路径,这是CMake caches的问题,不是软链接之类的问题,它还会去找旧的路径,所以删除catkin_ws/build下面的catkin_make.cache, Makefile, CMakeCache.txt. 然后重新编译,这样libcostmap_2d.so就不会再去链接1.8了