PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.95k stars 4.62k forks source link

[compile error] "The imported target "vtkParseOGLExt" references the file "/usr/bin/vtkParseOGLExt-7.1" but this file does not exist." #5632

Closed OsamaAlAhmadieh closed 1 year ago

OsamaAlAhmadieh commented 1 year ago

I get an error when building a project that uses pcl. I have the configuration in my CMakeLists.txt. The error is related to some vtk modules that can't be found.

Please paste the compilation results/errors.

To Reproduce

install pcl using sudo apt install libpcl-dev

create dummy project to include pcl in its CMakeLists.txt according to this link form the documentation (minor changes for the version)

cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(MY_GRAND_PROJECT)
find_package(PCL REQUIRED COMPONENTS common io)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable(pcd_write_test pcd_write.cpp)
target_link_libraries(pcd_write_test ${PCL_LIBRARIES})

Screenshots/Code snippets/Build information Then the error that I get is the following:

[cmake] -- The imported target "vtkParseOGLExt" references the file
[cmake]    "/usr/bin/vtkParseOGLExt-7.1"
[cmake] but this file does not exist.  Possible reasons include:
[cmake] * The file was deleted, renamed, or moved to another location.
[cmake] * An install or uninstall procedure did not complete successfully.
[cmake] * The installation package was faulty and contained
[cmake]    "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
[cmake] but not all the files it references.
[cmake] 
[cmake] -- The imported target "vtkRenderingPythonTkWidgets" references the file
[cmake]    "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
[cmake] but this file does not exist.  Possible reasons include:
[cmake] * The file was deleted, renamed, or moved to another location.
[cmake] * An install or uninstall procedure did not complete successfully.
[cmake] * The installation package was faulty and contained
[cmake]    "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
[cmake] but not all the files it references.
[cmake] 
[cmake] -- The imported target "pvtk" references the file
[cmake]    "/usr/bin/pvtk"
[cmake] but this file does not exist.  Possible reasons include:
[cmake] * The file was deleted, renamed, or moved to another location.
[cmake] * An install or uninstall procedure did not complete successfully.
[cmake] * The installation package was faulty and contained
[cmake]    "/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
[cmake] but not all the files it references.

Your Environment (please complete the following information):

Possible Solution

Additional context

It seems like a problem with vtk, I am sure I have the correct version of vtk installed for the corresponding pcl version (pcl 1.10 and vtk 7.1) I also made sure that these are the correct ones by running dpkg -s libpcl-dev and got the following result.

$ dpkg -s libpcl-dev                                                                                                                                                                            
Package: libpcl-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 11047
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Source: pcl
Version: 1.10.0+dfsg-5ubuntu1
Depends: libboost-all-dev, libeigen3-dev, libflann-dev, libvtk7-dev, libqhull-dev, libvtk7-qt-dev, libopenni-dev, libopenni2-dev, libpcl-apps1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-common1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-features1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-filters1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-io1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-kdtree1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-keypoints1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-ml1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-octree1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-outofcore1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-people1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-recognition1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-registration1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-sample-consensus1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-search1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-segmentation1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-stereo1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-surface1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-tracking1.10 (= 1.10.0+dfsg-5ubuntu1), libpcl-visualization1.10 (= 1.10.0+dfsg-5ubuntu1)
Suggests: libpcl-doc
Breaks: libvtk6-dev, libvtk6-java, libvtk6-jni, libvtk6-qt-dev
Description: Point Cloud Library - development files
 The Point Cloud Library (PCL) is a standalone, large scale, open
 project for 2D/3D image and point cloud processing.
 .
 The PCL framework contains numerous state-of-the art algorithms
 including filtering, feature estimation, surface reconstruction,
 registration, model fitting and segmentation.
 .
 This package contains development files (headers and shared library
 symbolic link).
Original-Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Homepage: http://www.pointclouds.org/

In the dependencies we can see libvtkdev7.

Please Help!

Thank you!

mvieth commented 1 year ago

@OsamaAlAhmadieh Yes, this is a problem with VTK. I don't think there is anything we can do on the PCL side. But are you sure that these are errors? I think they are just warnings which you can (safely) ignore.

OsamaAlAhmadieh commented 1 year ago

@mvieth Thanks for the quick reply! I was so focused on getting rid of them didn't think of trying to run my code. Yes they were just warnings. Thanks

hitbuyi commented 5 months ago

I have the same problem, have you solved it?

jikexiaohgege commented 3 months ago

@mvieth感谢您的快速回复!我太专注于摆脱它们了,没有想到尝试运行我的代码。是的,它们只是警告。谢谢 Hello, I have the same warning as you, and I also have some additional errors regarding PCL. Could you help me with those?

WARNING io features related to pcap will be disabled WARNING io features related to png will be disabled CMake Warning (dev) at /home/rain/software/ide/clion/clion-2022.2.4/bin/cmake/linux/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to find_package_handle_standard_args (libusb-1.0) does not match the name of the calling package (PCL). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND) to follow a certain pattern. Call Stack (most recent call first): /usr/local/share/pcl-1.10/PCLConfig.cmake:285 (find_package_handle_standard_args) /usr/local/share/pcl-1.10/PCLConfig.cmake:332 (find_libusb) /usr/local/share/pcl-1.10/PCLConfig.cmake:535 (find_external_library) CMakeLists.txt:45 (find_package) This warning is for project developers. Use -Wno-dev to suppress it.

WARNING io features related to libusb-1.0 will be disabled -- QHULL found (include: /usr/include, lib: optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so) -- looking for PCL_COMMON CMake Warning (dev) at /home/rain/software/ide/clion/clion-2022.2.4/bin/cmake/linux/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to find_package_handle_standard_args (PCL_COMMON) does not match the name of the calling package (PCL). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND) to follow a certain pattern. Call Stack (most recent call first): /usr/local/share/pcl-1.10/PCLConfig.cmake:603 (find_package_handle_standard_args) CMakeLists.txt:45 (find_package) This warning is for project developers. Use -Wno-dev to suppress it.

-- looking for PCL_KDTREE CMake Warning (dev) at /home/rain/software/ide/clion/clion-2022.2.4/bin/cmake/linux/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to find_package_handle_standard_args (PCL_KDTREE) does not match the name of the calling package (PCL). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND) to follow a certain pattern. Call Stack (most recent call first): /usr/local/share/pcl-1.10/PCLConfig.cmake:603 (find_package_handle_standard_args) CMakeLists.txt:45 (find_package) This warning is for project developers. Use -Wno-dev to suppress it.