• Ubuntu 20.04.05安装PCL-1.12.0


    1、安装QT-5.9.9

    链接1: Ubuntu20.04安装、配置、使用、卸载QT5.9.9以及第一个编写QT程序.
    或者
    链接2: 在ubuntu用命令安装和卸载qt4、qt5(亲测有效).

    2、安装VTK-7.1.1+PCL-1.12.0

    链接1: ubuntu20.04下安装pcl.
    或者
    链接2: PCL1.12+VTK7.1.1 && Ubuntu20.04.3+VSCode(官网最新版2022.01).

    VTK安装成功测试:https://www.jb51.cc/server/4186930.html

    3、cmake-gui编译VTK遇到的问题

    (1)CMP0022(Warning)

    问题描述:CMake Deprecation Warning at ThirdParty/libproj4/vtklibproj4/cmake/policies.cmake:2 (cmake_policy):> The OLD behavior for policy CMP0022 will be removed from a future version of CMake.
    The cmake-policies(7) manual explains that the OLD behaviors of all policies are deprecated and that a policy should be set to OLD only under specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD. Call Stack (most recent call first): ThirdParty/libproj4/vtklibproj4/CMakeLists.txt:43 (include)
    解决方法:/VTK-7.1.1/ThirdParty/libproj4/vtklibproj4/cmake/policies.cmake对应与Policy CMP0022修改,如下。

    if (CMAKE_MAJOR_VERSION GREATER 2)
        cmake_policy(SET CMP0022 NEW) # interface link libraries
        cmake_policy(SET CMP0042 NEW) # osx rpath
        cmake_policy(SET CMP0011 NEW) # policy setting
    endif()
    
    • 1
    • 2
    • 3
    • 4
    • 5

    (2)CMP0072(Warning)

    问题描述:CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FindOpenGL.cmake:275 (message): Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when available. Run “cmake --help-policy CMP0072” for policy details. Use the cmake_policy command to set the policy and suppress this warning.
    FindOpenGL found both a legacy GL library:
    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so
    and GLVND libraries for OpenGL and GLX:
    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so
    OpenGL_GL_PREFERENCE has not been set to “GLVND” or “LEGACY”, so for
    compatibility with CMake 3.10 and below the legacy GL library will be used.
    Call Stack (most recent call first): CMake/vtkOpenGL.cmake:77 (find_package)
    Rendering/VolumeOpenGL2/CMakeLists.txt:67 (include)
    This warning is for project developers. Use -Wno-dev to suppress it.
    解决方法: 在/VTK-7.1.1/CMakeLists.txt文件中加入下面内容。

    if (POLICY CMP0072)
    	set(OpenGL_GL_PREFERENCE LEGACY)
    endif()
    
    • 1
    • 2
    • 3

    如下图所示。
    在这里插入图片描述

    4、cmake编译PCL遇到的问题

    (1)ClangFormat

    问题描述:Could NOT find ClangFormat (missing: ClangFormat_EXECUTABLE ClangFormat_VERSION) (Required is at least version “10”)
    解决方法:sudo apt-get install clang-format-10

    (2)metslib

    问题描述:Checking for module ‘metslib’ – No package ‘metslib’ found
    解决方法:下载并安装metslib包,下载链接: metslib-0.5.3.,解压并进入metslib-0.5.3文件夹,然后执行
    sudo sh ./configure
    sudo make
    sudo make install

    (3)PNG

    问题描述:Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
    解决方法:sudo apt-get install libpng-dev

    (4)PCAP

    问题描述:Could NOT find Pcap (missing: PCAP_LIBRARIES PCAP_INCLUDE_DIRS)
    解决方法:安装pcap包,依次执行
    git clone https://github.com/the-tcpdump-group/libpcap
    cd libpcap
    ./configure # 可能会遇到 configure: error: Neither flex nor lex was found. 见下“
    make -j8
    sudo make install

    :如果在./configure时出现 configure: error: Neither flex nor lex was found.
    运行:sudo apt-get install flex bison

    (5)GLEN

    问题描述:Could NOT find GLEW (missing: GLEW_INCLUDE_DIR GLEW_LIBRARY)
    解决方法:sudo apt install libglew-dev

  • 相关阅读:
    LeetCode27——移除元素
    山东大学高频电子线路实验七 锁相环调频及解调实验详解
    十七、Java 方法
    Jquery中事件
    jmh测试实践(针对不同准备数据测试)
    物联网通信技术|课堂笔记|week10-2 11月1日|应用层协议|域名解析
    Electron和vue3集成(推荐仅用于开发)
    QML自定义TabView样式
    数据结构:排序算法
    使用postman 调用 Webservice 接口
  • 原文地址:https://blog.csdn.net/zhiTjun/article/details/128067182