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()

(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()

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

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

  • 0
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值