linux 为什么cmake不为pcl编译

k4ymrczo  于 2023-01-25  发布在  Linux
关注(0)|答案(1)|浏览(183)

我正在尝试编译WSL中新安装的PCL库。我遵循了线程中给出的步骤:https://stackoverflow.com/questions/58040066/how-to-compile-point-cloud-library-pcl-with-examples-ubuntu。我安装了线程中提到的所有必需的依赖项,但遇到编译错误。

CMake Deprecation Warning at CMakeLists.txt:15 (cmake_policy):
The OLD behavior for policy CMP0048 will be removed from a futur 
version of CMake.l/lib/cmake/vtk 9.2/FindFreetype.cmake:179(vtk_detect_library_type) 
/usr/local/lib/cmake/vtk-9.2/patches/3.19/FindX11.cmake:235(find_package)
The cmake-policies(7) manual explains that the OLD behaviors of al 
(find_package) 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.


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.  

--Could NOT find LIBUSB_1 (missing: LIBUSB_1_LIBRARY LIBUSB_1_INCLUDE_DIR)
-- Checking for module 'metslib'
-- No package 'metslib' found
-- Configuring incomplete, errors occurred!
-- QHULL found (include: /usr/include, lib: 
   optimized;/usr/lib/x86_64-linux gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so)
   CMake Error at /usr/local/lib/cmake/vtk 9.2/vtkDetectLibraryType.cmake:23 (message):
   The `PATH` argument is required.
    
   Projects should be ported to the NEW behavior and not rely on 
   setting a policy to OLD.

我不太明白第一行写的警告。它和Cmake版本有什么关系吗?我是Cmake的新手,不能弄清楚这一点。如果能得到一些帮助,我将不胜感激:)

xqkwcwgp

xqkwcwgp1#

你试图在一个WSL上编译,它只是一个子系统,也就是说,它没有一个X-server。就这么简单。看这一行:

/usr/local/lib/cmake/vtk-9.2/patches/3.19/FindX11.cmake:235(find_package)

长话短说,你不可能在WSL上编译它,因为VTK需要一个X-server来实现它的可视化,你需要从启动和运行X-server开始。我真的不知道这将如何在WSL上运行,即使你有一个X-server来处理WSL,但是我可能错了。
编辑:显然,通过转发它可以让一个X服务器WSL上工作,但我仍然相信(特别是因为你是新来的),这比仅仅让一个双引导工作要多得多。
编辑2:Tsyvarev很好心地提供了一个关于如何获得X-server configured on WSL的很棒的链接。

相关问题