• ubuntu18.04安装pangolin库,图文详解


    1. 终端输入命令,安装所需依赖

    sudo apt install libglew-dev cmake libboost-dev libboost-thread-dev libboost-filesystem-dev libeigen3-dev -y 
    
    • 1

    2、下载源码压缩包

    git clone https://github.com/stevenlovegrove/Pangolin.git
    
    • 1

    3、解压文件,cd到该目录中

    unzip  Pangolin && cd Pangolin
    
    • 1

    4、创建build文件夹,cd到该目录中

    mkdir build && cd build
    
    • 1

    5、cmake分析源代码

    cmake ..
    
    • 1

    可能会遇到下面这样的报错

    CMake Error at CMakeLists.txt:109 (add_library):
      Target "pango_opengl" links to target "Eigen3::Eigen" but the target was
      not found.  Perhaps a find_package() call is missing for an IMPORTED
      target, or an ALIAS target is missing?
    
    
    CMake Error at CMakeLists.txt:109 (add_library):
      Target "pango_glgeometry" links to target "Eigen3::Eigen" but the target
      was not found.  Perhaps a find_package() call is missing for an IMPORTED
      target, or an ALIAS target is missing?
    
    
    CMake Error at CMakeLists.txt:109 (add_library):
      Target "pango_glgeometry" links to target "Eigen3::Eigen" but the target
      was not found.  Perhaps a find_package() call is missing for an IMPORTED
      target, or an ALIAS target is missing?
    
    
    CMake Error at CMakeLists.txt:109 (add_library):
      Target "pango_plot" links to target "Eigen3::Eigen" but the target was not
      found.  Perhaps a find_package() call is missing for an IMPORTED target, or
      an ALIAS target is missing?
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23

    报错显示找不到eigen库,那我们修改下components/pango_geometry和components/pango_opengl文件夹下的CMakeLists.txt。
    添加这一行:include_directories(/usr/include/eigen3)
    修改这一行:target_link_libraries(${COMPONENT} PUBLIC pango_core pango_image ${Eigen3_LIBRARIES})

    添加的是为了后面make成功,修改的是为了cmake成功,然后保存,再次cmake..成功。

    在这里插入图片描述
    如果你cmake报错: 缺少xkbcommon库,然后你安装libxkbcommon-x11-dev出现以下报错:

    libxkbcommon-x11-dev : 依赖: libxkbcommon-x11-0 (= 0.8.0-1ubuntu0.1) 
    但是 0.8.2-1~ubuntu18.04.1 正要被安装
    
    • 1
    • 2

    就说明你下载的pangolin版本不适用于你的ubuntu版本,不要使用网上的方法强制降低版本,那样会导致你很多依赖库opencv、pcl、ros被卸载,正确做法是重新下载个低版本的pangollin。

    6、make编译源代码

    sudo make -j4
    
    • 1

    在这里插入图片描述

    7、make install安装

    sudo make install
    
    • 1

    在这里插入图片描述

    至此,pangolin库安装完成!

  • 相关阅读:
    最长的顺子
    分享一个python无人超市管理系统django项目实战源码调试 lw 开题
    Netty编码和解码
    Linux文件系统
    手把手教学一文安装Keil5(MDK)固件支持包
    【RocketMQ】RocketMQ 5.0新特性(三)- Controller模式
    C/C++内存管理
    线性动态规划
    项目管理之系统交付
    解决:在单项目组件里面引入 base.scss/ base.less 等的外部文件不成功的问题
  • 原文地址:https://blog.csdn.net/qq_42257666/article/details/125473414