ubuntu20.04+Vtk 7.1.1+pcl 安装过程中出现的问题

按照之前的博客ubuntu20.04下安装pcl_Yuannau_jk的博客-CSDN博客_ubuntu20.04安装pcl

问题1.  在安装vtk的过程中,cmake-gui中

勾选“VTK-Group-Qt”,点击“Configure”后,出现错误,解决办法如下

          如果你已经安装好qt5以上的版本

          参考ubuntu16.04下安装pcl1.8遇到的问题_kxk_ustc的博客-CSDN博客

如果还是出现错误,如以下的问题:

  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)
  Domains/ChemistryOpenGL2/CMakeLists.txt:31 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5X11Extras" with
  any of the following names:

    Qt5X11ExtrasConfig.cmake
    qt5x11extras-config.cmake

  Add the installation prefix of "Qt5X11Extras" to CMAKE_PREFIX_PATH or set
  "Qt5X11Extras_DIR" to a directory containing one of the above files.  If
  "Qt5X11Extras" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  GUISupport/Qt/CMakeLists.txt:63 (find_package)

   安装 sudo apt install libqt5x11extras5-dev 即可。

参考:

从【问题解决】编译VTK时CMAKE中找不到Qt5X11Extras_danxibaoxxx的博客-CSDN博客


 

问题2.  在安装vtk的过程中,cmake-gui中

勾选“VTK-Group-Qt”,点击“Configure”后,出现错误,解决办法如下

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:26 (find_package): Could not find a package configuration file provided by “Qt5UiPlugin” with any of the following names: Add the installation prefix of "Qt5UiPlugin" to CMAKE_PREFIX_PATH or set "Qt

sudo apt-get install qttools5-dev

问题3 在运行pcl测试用例是./pcl_test中

jie@jie:~/Visual_test/pcl库_test/test2/build$ ./pcl_test 
./pcl_test: error while loading shared libraries: libvtkCommonMisc-7.1.so.1: cannot open shared object file: No such file or directory

这是由于环境变量当中没有设置libvtkCommonMisc的目录导致的,解决方法:
打开终端:

(1):

whereis libvtkCommonMisc-7.1.so.1

先查看有没有.so库文件:

include /etc/ld.so.conf.d/*.conf

/usr/local/lib

本人电脑上的运行结果是:

$ whereis libvtkCommonMisc-7.1.so.1
libvtkCommonMisc-7.1.so: /usr/lib/x86_64-linux-gnu/libvtkCommonMisc-7.1.so /usr/local/lib/libvtkCommonMisc-7.1.so.1 /usr/local/lib/libvtkCommonMisc-7.1.so

可知有两个路径 /usr/lib/x86_64-linux-gnu  和 /usr/local/lib

2) 查看/etc/ld.so.conf里的内容

cat /etc/ld.so.conf

本人电脑上的运行结果是:

include /etc/ld.so.conf.d/*.conf

/usr/local/lib

(3)将/usr/lib/x86_64-linux-gnu包含进去

sudo sh -c "echo '/usr/lib/x86_64-linux-gnu' >> /etc/ld.so.conf"

(4)更新配置

sudo sh -c "ldconfig"

猜你喜欢

转载自blog.csdn.net/m0_48919875/article/details/125439700
今日推荐