ubuntu编译pcl库记录

本文详细描述了在Ubuntu系统中安装PCL库的过程,包括解决依赖问题如VTK、OpenGL、boost、libglu1-mesa-dev和freeglut3-dev等,以及在cmake和编译过程中遇到的错误和解决方法,如缺少libpcap-dev、glut和boost_filesystem的问题。
摘要由CSDN通过智能技术生成

官方安装文档
https://pcl.readthedocs.io/projects/tutorials/en/master/compiling_pcl_posix.html#compiling-pcl-posix

依赖的安装

在安装文档中写了pcl的依赖库

  1. vtk的下载地址https://vtk.org/download/,这里我下载的是9.2.6,然后cmake make ,sudo make install 即可

    • 报错没有opengl 使用sudo apt-get install --reinstall libgl1-mesa-dev
    • X11_Xt_LIB could not be found ,执行sudo apt-get install libxt-dev
    • 8.2.0编译时报错multiple definition of exodus_unused_symbol_dummy_1,然后更换版本到9.2.6
    • cmake的时候X11::Xcursor not found,使用sudo apt-get install libxcursor-dev后解决
  2. eigen可以使用sudo apt-get install libeigen3-dev来安装

  3. boost可使用sudo apt-get install libboost-all-dev来安装

  4. flann可以使用sudo apt-get install libflann-dev

pcl安装

首先下载源码

git clone https://github.com/PointCloudLibrary/pcl.git

Please note that cmake might default to a debug build. If you want to compile a release build of PCL with enhanced compiler optimizations, you can change the build target to “Release” with “-DCMAKE_BUILD_TYPE=Release”:

cmake -DCMAKE_BUILD_TYPE=Release ..
make -j8
sudo make install 

pcl编译中的报错

cmake阶段

1.Could NOT find Pcap

sudo apt-get install libpcap-dev

2.No package ‘glut’ found

--   No package 'glut' found
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:141 (find_package):
  Could not find a package configuration file provided by "boost_filesystem"
  (requested version 1.74.0) with any of the following names:

    boost_filesystemConfig.cmake
    boost_filesystem-config.cmake

  Add the installation prefix of "boost_filesystem" to CMAKE_PREFIX_PATH or
  set "boost_filesystem_DIR" to a directory containing one of the above
  files.  If "boost_filesystem" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake:258 (boost_find_component)
  /usr/share/cmake-3.22/Modules/FindBoost.cmake:594 (find_package)
  cmake/pcl_find_boost.cmake:30 (find_package)
  CMakeLists.txt:423 (include)


执行以下安装glut
sudo apt-get install build-essential
sudo apt-get install libgl1-mesa-dev  
sudo apt-get install libglu1-mesa-dev 
sudo apt-get install libglut-dev 

运行4后若出现 E:Unable to locate package libglut-dev, 可安装freeglut库(一个开源的glut库)替代:
sudo apt-get install freeglut3-dev

做了以上操作发现还是不能解决,细读报错发现说是boost相关,检查发现是忘装boost了,装后成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值