c++ - 在 Ubuntu 16.04 上编译 PCL 1.7,CMake 生成的 Makefile 中的错误

标签 c++ ubuntu makefile cmake point-cloud-library

我正在尝试让 PCL 1.7(点云库,而不是其他 pcl)在 Ubuntu 16.04 上运行。我最终希望用于 C++ 的东西,但现在我只是想让示例工作。我使用的是 Ubuntu (GNU 5.3.1) 和 Cmake 版本 3.5.2 附带的默认编译器。我一直在按照 PCL 网站(herehere)上的说明进行操作,但在让 Cmake 构建它想要构建的东西之后,我目前停留在使用“make”命令的地步。这是我得到的错误

[ 50%] Building CXX object CMakeFiles/pcd_write.dir/pcd_write.cpp.o
<command-line>:0:15: warning: missing whitespace after the macro name
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libproj.so', needed by 'pcd_write'.  Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pcd_write.dir/all' failed
make[1]: *** [CMakeFiles/pcd_write.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

当我构建东西时,Cmake 也会给我警告,这些都在这里。它们不会阻止它运行,但它们可能是相关的。

-- Found OpenNI2: /usr/lib/libOpenNI2.so  
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   " /usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
    but not all the files it references.

另外,如果它是相关的,我早些时候做了一件可能很愚蠢的事情,当时它给我类似的关于 VTK 的警告。它告诉我/user/bin/vtk 被重命名或什么的,它是。这个版本的 VTK 称自己为 vtk6。我试图在 makefile 中查找并更改它,以便 Cmake 知道要查找 vtk6,但我无法在任何地方找到它,所以我进入 bin 并制作了一个名为 vtk 的 vtk6 拷贝,它停止了给我一个警告。

我使用的其他相关版本是 eigen3 3.2.92、boost 1.58.0、flan 1.8.4、vtk6 和 libopenni2 版本 2.2.0.3

同样,不确定其中有多少实际上很重要,但在我看来,过于具体总比过于模糊要好。

最佳答案

这个错误仍然存​​在于 16.04 中,但有一个解决方法。

  1. sudo apt install libproj-dev

  2. 将以下行添加到您的 CMakeLists.txt 文件:
    list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")

第一个提供必要的 libproj.so,第二个修复链接到不存在(且不必要)的 libvtkproj4 时的错误。

关于不存在的引用文件的其他错误似乎是无害的(或者至少我的项目尽管有相同的错误也能编译)。

更多信息,请参阅:
https://bugs.launchpad.net/ubuntu/+source/pcl/+bug/1573174
https://bugs.launchpad.net/ubuntu/+source/vtk6/+bug/1573234

关于c++ - 在 Ubuntu 16.04 上编译 PCL 1.7,CMake 生成的 Makefile 中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37369369/

相关文章:

c++ - 动态内存和链表

python - 如何在 Linux 上使用 venv 设置 Django 环境变量?

ubuntu - Kubernetes 集群内部没有解析外部 DNS 请求

opencv - 使用Cygwin编译OpenCV Android

c++ - 使用 macports 安装 opencv 并在 qt (osx) 中使用

c++ - 命令行参数读取文本文件

C++ 异常处理指南

apache - 我的 httpd.conf 是空的

c - 制作共享对象错误时如何修复局部符号'不能使用?

c++ - mysql C++ 不会用 make 编译,但如果 g++ 参数放在 cmd 行