1. 程式人生 > >安裝PCL1.8 與 boost1.58 的衝突問題 (Ubuntu 16.04)

安裝PCL1.8 與 boost1.58 的衝突問題 (Ubuntu 16.04)

在按照pcl官網上的Ubuntu16 安裝步驟(https://larrylisky.com/2016/11/03/point-cloud-library-on-ubuntu-16-04-lts/),編譯安裝pcl的原始碼時候,報錯出現如下問題:

../../lib/libpcl_visualization.so.1.9.0:對‘boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&)’未定義的引用
collect2: error: ld returned 1 exit status
visualization/tools/CMakeFiles/pcl_hdl_viewer_simple.dir/build.make:140: recipe for target 'bin/pcl_hdl_viewer_simple' failed
make[2]: *** [bin/pcl_hdl_viewer_simple] Error 1
CMakeFiles/Makefile2:1170: recipe for target 'visualization/tools/CMakeFiles/pcl_hdl_viewer_simple.dir/all' failed
make[1]: *** [visualization/tools/CMakeFiles/pcl_hdl_viewer_simple.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

根據提示推斷出來,這個問題是boost的問題,需要將boost的版本更新一下,但是在Ubuntu中是找不到比boost1.58更新的源,所以需要自己下載原始碼編譯並安裝,更新過程如下:

 

1、刪除boost1.58(可不刪除,因為會刪除ROS的一些,謹慎)

libboost1.58-all-dev

注意:在刪除boost的時候會提示 要解除安裝ROS的一些東西,大家根據自己情況而定,因為我會使用ROS所以這一步就沒操作

2、下載boost1.60原始碼

可以從官網上下載,但是速度特別慢

https://sourceforge.net/projects/boost/files/boost-binaries/1.60.0/

推薦在下面的連結進行下載,根據你的系統進行下載:

https://www.boost.org/users/history/version_1_60_0.html

3、解壓原始碼並進入目錄

4、檢視需要單獨編譯模組

./bootstrap.sh --show-libraries

5、選擇編譯模組

./bootstrap.sh --with-libraries= atomic,chrono,container,context,coroutine,coroutine2,date_time,exception,filesystem,graph,graph_parallel,iostreams,locale,with-log,math,metaparse,mpi,program_options,python,random,regex,serialization,signals,system,test,thread,timer,type_erasure,wave

6、編譯

sudo ./b2 install

7、複製標頭檔案

sudo cp -a stage/lib /usr
sudo cp -a boost /usr/include

然後重新按照正常安裝pcl即可