我正在尝试让 PCL 1.7(点云库,而不是其他 pcl)在 Ubuntu 16.04 上运行。我最终希望用于 C++ 的东西,但现在我只是想让这些示例正常工作。我正在使用 Ubuntu (GNU 5.3.1) 和 Cmake 3.5.2 版附带的默认编译器。我一直在遵循 PCL 网站上的说明( 此处 和 此处),但目前我停留在让 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
同样,不确定其中有多少实际上是重要的,但过于具体而不是过于模糊的 IMO 更好。
原文由 Brandon Powers 发布,翻译遵循 CC BY-SA 4.0 许可协议
此错误仍在 16.04 中,但有一个解决方法。
sudo apt install
libproj-dev
将以下行添加到您的 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