PointCloudLibrary / pcl

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

undefined reference to `pcl::visualization::PCLVisualizer: #5451

Closed bigfacecat553 closed 1 year ago

bigfacecat553 commented 1 year ago

Hi, gays. I want to compile the example code from https://github.com/PointCloudLibrary/pcl/blob/82b54a2b7d583f788abf13ddc0ddee8071cb5b09/doc/tutorials/content/sources/interactive_icp/interactive_icp.cpp

when I do catkin_make, several mistakes happen, which seems like this : https://github.com/PointCloudLibrary/pcl/issues/4472 and I try to fix the problem like him by moving the files manually from PCL/build/lib to /usr/local/lib. But I can't find thePCL/build/lib.
It seems that he

compiled from source

, and I just install the pcl by sudo apt xxx So how can I fix the problem?

I had another problem when I installed the pcl several days ago, and I fixed it at that time. Does this problem have anything to do with it? https://github.com/PointCloudLibrary/pcl/issues/5445

Environment (please complete the following information):

More details

[100%] Linking CXX executable /data0/alexFiles/pointcloudtest/devel/lib/chapter10_tutorials/example
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `void pcl::visualization::PCLVisualizer::convertPointCloudToVTKPolyData<pcl::PointXYZ>(pcl::visualization::PointCloudGeometryHandler<pcl::PointXYZ> const&, vtkSmartPointer<vtkPolyData>&, vtkSmartPointer<vtkIdTypeArray>&)':
/usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:307: undefined reference to `pcl::visualization::PCLVisualizer::updateCells(vtkSmartPointer<vtkIdTypeArray>&, vtkSmartPointer<vtkIdTypeArray>&, long long)'
/bin/ld: /usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:289: undefined reference to `pcl::visualization::PCLVisualizer::allocVtkPolyData(vtkSmartPointer<vtkPolyData>&)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `bool pcl::visualization::PCLVisualizer::updatePointCloud<pcl::PointXYZ>(pcl::PointCloud<pcl::PointXYZ>::ConstPtr const&, 
pcl::visualization::PointCloudColorHandler<pcl::PointXYZ> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:1583: undefined reference to `pcl::visualization::PCLVisualizer::updateCells(vtkSmartPointer<vtkIdTypeArray>&, vtkSmartPointer<vtkIdTypeArray>&, long long)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `bool pcl::visualization::PCLVisualizer::fromHandlersToScreen<pcl::PointXYZ>(pcl::visualization::PointCloudGeometryHandler<pcl::PointXYZ> const&, pcl::visualization::PointCloudColorHandler<pcl::PointXYZ> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&)':
** WARNING ** io features related to png will be disabled
** WARNING ** io features related to libusb-1.0 will be disabled
-- looking for PCL_COMMON
-- Could NOT find PCL_COMMON (missing: PCL_COMMON_LIBRARY) 
-- looking for PCL_KDTREE
-- Could NOT find PCL_KDTREE (missing: PCL_KDTREE_LIBRARY) 
-- looking for PCL_GEOMETRY
-- looking for PCL_OCTREE
-- Could NOT find PCL_OCTREE (missing: PCL_OCTREE_LIBRARY) 
-- looking for PCL_SEARCH
-- Could NOT find PCL_SEARCH (missing: PCL_SEARCH_LIBRARY) 
-- looking for PCL_VISUALIZATION
-- Could NOT find PCL_VISUALIZATION (missing: PCL_VISUALIZATION_LIBRARY) 
-- looking for PCL_IO
-- Could NOT find PCL_IO (missing: PCL_IO_LIBRARY) 
-- Configuring done

My cmakelist file

cmake_minimum_required(VERSION 3.5)
project(chapter10_tutorials)

find_package(catkin REQUIRED COMPONENTS
  pcl_ros
  roscpp
  rospy
  sensor_msgs
  std_msgs
)

find_package(PCL COMPONENTS common visualization io REQUIRED)

catkin_package()

include_directories(
  include
  ${catkin_INCLUDE_DIRS}

)

include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

add_executable(pcl_create src/pcl_create.cpp)
add_executable(pcl_downsampling src/pcl_downsampling.cpp)
add_executable(pcl_filter src/pcl_filter.cpp)
add_executable(pcl_matching src/pcl_matching.cpp)
add_executable(pcl_model_estimation src/pcl_model_estimation.cpp)
add_executable(pcl_partitioning src/pcl_partitioning.cpp)
add_executable(pcl_planar_segmentation src/pcl_planar_segmentation.cpp)
add_executable(pcl_read src/pcl_read.cpp)
add_executable(pcl_visualize src/pcl_visualize.cpp)
add_executable(pcl_write src/pcl_write.cpp)
add_executable(example src/example.cpp)

target_link_libraries(pcl_create ${catkin_LIBRARIES} ${PCL_LIBRARIES})
target_link_libraries(pcl_downsampling ${catkin_LIBRARIES} ${PCL_LIBRARIES})
target_link_libraries(pcl_filter ${catkin_LIBRARIES} ${PCL_LIBRARIES})
target_link_libraries(pcl_matching ${catkin_LIBRARIES} ${PCL_LIBRARIES})
target_link_libraries(pcl_model_estimation ${catkin_LIBRARIES} ${PCL_LIBRARIES})
target_link_libraries(pcl_partitioning ${catkin_LIBRARIES} ${PCL_LIBRARIES})
target_link_libraries(pcl_planar_segmentation ${catkin_LIBRARIES} ${PCL_LIBRARIES})
target_link_libraries(pcl_read ${catkin_LIBRARIES} ${PCL_LIBRARIES})
target_link_libraries(pcl_visualize ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${PCL_VISUALIZATION_LIBRARIES})
target_link_libraries(pcl_write ${catkin_LIBRARIES} ${PCL_LIBRARIES})
target_link_libraries(example ${catkin_LIBRARIES} ${PCL_LIBRARIES} ${PCL_VISUALIZATION_LIBRARIES})
mvieth commented 1 year ago

You should call find_package like this: find_package(PCL REQUIRED COMPONENTS common visualization io) instead of this: find_package(PCL COMPONENTS common visualization io REQUIRED) Notice where the REQUIRED keyword is placed. If you put it at the end, it doesn't have any effect.

Did I understand it correctly that you want to install PCL via apt, and not compile it from source? The libraries are usually only placed in /usr/local/lib when PCL is compiled from source. When installed via apt, the libraries should be found in /usr/lib/x86_64-linux-gnu/, e.g. /usr/lib/x86_64-linux-gnu/libpcl_visualization.so.1.10.0

bigfacecat553 commented 1 year ago

You should call find_package like this: find_package(PCL REQUIRED COMPONENTS common visualization io) instead of this: find_package(PCL COMPONENTS common visualization io REQUIRED) Notice where the REQUIRED keyword is placed. If you put it at the end, it doesn't have any effect.

Did I understand it correctly that you want to install PCL via apt, and not compile it from source? The libraries are usually only placed in /usr/local/lib when PCL is compiled from source. When installed via apt, the libraries should be found in /usr/lib/x86_64-linux-gnu/, e.g. /usr/lib/x86_64-linux-gnu/libpcl_visualization.so.1.10.0

Thanks, I tried find_package(PCL REQUIRED COMPONENTS common visualization io) , and it still reports the same problem, Could NOT find PCL xxx missing xxxxx, then undefined reference topcl::visualization::PCLVisualizer::updateCell`.

I got thefind_package(PCL COMPONENTS common visualization io REQUIRED) from https://github.com/kunaltyagi/pcl-cmake-minimum/blob/master/CMakeLists.txt It tells me that if pcl>1.9, you should use it and I actually used it.

Another thing is that I got the solution to similar problem https://github.com/PointCloudLibrary/pcl/issues/4472. But there is something different, and he just Copy files from /PCL/build/libs to /usr/local/libs. His PCL Type: Compiled from source successfully So how should I handle it? I can find all my files in /usr/lib/x86_64-linux-gnu/, e.g. /usr/lib/x86_64-linux-gnu/libpcl_visualization.so.1.10.0

Why it reported that Could NOT find PCL_xxxx (missing: PCL_xxxx_LIBRARY) ? Should I copy all the xxx.so files from/usr/lib/x86_64-linux-gnu/ to other place, e.g. /usr/local/libs ?

bigfacecat553 commented 1 year ago

more details:

 catkin_make
Base path: /data0/alexFiles/pointcloudtest
Source space: /data0/alexFiles/pointcloudtest/src
Build space: /data0/alxexFiles/pointcloudtest/build
Devel space: /data0/alexFiles/pointcloudtest/devel
Install space: /data0/alexFiles/pointcloudtest/install
####
#### Running command: "make cmake_check_build_system" in "/data0/alexFiles/pointcloudtest/build"
####
-- Using CATKIN_DEVEL_PREFIX: /data0/alexFiles/pointcloudtest/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/noetic
-- This workspace overlays: /opt/ros/noetic
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Using Debian Python package layout
-- Using empy: /usr/lib/python3/dist-packages/em.py
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /data0/alexFiles/pointcloudtest/build/test_results
-- Forcing gtest/gmock from source, though one was otherwise available.
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python3 (found version "3.8.10") 
-- Using Python nosetests: /bin/nosetests3
-- catkin 0.8.10
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - chapter10_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'chapter10_tutorials'
-- ==> add_subdirectory(chapter10_tutorials)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Eigen found (include: /usr/include/eigen3, version: 3.3.7)
-- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so)
-- OpenNI2 found (include: /usr/include/openni2, lib: /usr/lib/libOpenNI2.so)
-- The imported target "vtkParseOGLExt" references the file
   "/usr/bin/vtkParseOGLExt-7.1"
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-7.1/VTKTargets.cmake"
but not all the files it references.

-- 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-7.1/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
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-7.1/VTKTargets.cmake"
but not all the files it references.

-- The imported target "pvtk" references the file
   "/usr/bin/pvtk"
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-7.1/VTKTargets.cmake"
but not all the files it references.

-- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so)
-- OpenNI2 found (include: /usr/include/openni2, lib: /usr/lib/libOpenNI2.so)
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
** WARNING ** io features related to libusb-1.0 will be disabled
-- looking for PCL_COMMON
-- Could NOT find PCL_COMMON (missing: PCL_COMMON_LIBRARY) 
-- looking for PCL_KDTREE
-- Could NOT find PCL_KDTREE (missing: PCL_KDTREE_LIBRARY) 
-- looking for PCL_GEOMETRY
-- looking for PCL_OCTREE
-- Could NOT find PCL_OCTREE (missing: PCL_OCTREE_LIBRARY) 
-- looking for PCL_SEARCH
-- Could NOT find PCL_SEARCH (missing: PCL_SEARCH_LIBRARY) 
-- looking for PCL_VISUALIZATION
-- Could NOT find PCL_VISUALIZATION (missing: PCL_VISUALIZATION_LIBRARY) 
-- looking for PCL_IO
-- Could NOT find PCL_IO (missing: PCL_IO_LIBRARY) 
-- Configuring done
-- Generating done
-- Build files have been written to: /data0/alexFiles/pointcloudtest/build
####
#### Running command: "make -j40 -l40" in "/data0/alexFiles/pointcloudtest/build"
####
[  9%] Built target pcl_downsampling
[ 18%] Built target pcl_read
[ 27%] Built target pcl_filter
[ 36%] Built target pcl_model_estimation
[ 45%] Built target pcl_matching
[ 72%] Built target pcl_create
[ 72%] Built target pcl_visualize
[ 72%] Built target pcl_write
[ 81%] Built target pcl_partitioning
[ 90%] Built target pcl_planar_segmentation
[ 95%] Linking CXX executable /data0/alexFiles/pointcloudtest/devel/lib/chapter10_tutorials/example
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `void pcl::visualization::PCLVisualizer::convertPointCloudToVTKPolyData<pcl::PointXYZ>(pcl::visualization::PointCloudGeometryHandler<pcl::PointXYZ> const&, vtkSmartPointer<vtkPolyData>&, vtkSmartPointer<vtkIdTypeArray>&)':
/usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:307: undefined reference to `pcl::visualization::PCLVisualizer::updateCells(vtkSmartPointer<vtkIdTypeArray>&, vtkSmartPointer<vtkIdTypeArray>&, long long)'
/bin/ld: /usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:289: undefined reference to `pcl::visualization::PCLVisualizer::allocVtkPolyData(vtkSmartPointer<vtkPolyData>&)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `bool pcl::visualization::PCLVisualizer::updatePointCloud<pcl::PointXYZ>(pcl::PointCloud<pcl::PointXYZ>::ConstPtr const&, pcl::visualization::PointCloudColorHandler<pcl::PointXYZ> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:1583: undefined reference to `pcl::visualization::PCLVisualizer::updateCells(vtkSmartPointer<vtkIdTypeArray>&, vtkSmartPointer<vtkIdTypeArray>&, long long)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `bool pcl::visualization::PCLVisualizer::fromHandlersToScreen<pcl::PointXYZ>(pcl::visualization::PointCloudGeometryHandler<pcl::PointXYZ> const&, pcl::visualization::PointCloudColorHandler<pcl::PointXYZ> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&)':
/usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:1320: undefined reference to `pcl::visualization::PCLVisualizer::createActorFromVTKDataSet(vtkSmartPointer<vtkDataSet> const&, vtkSmartPointer<vtkLODActor>&, bool)'
/bin/ld: /usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:1325: undefined reference to `pcl::visualization::PCLVisualizer::addActorToRenderer(vtkSmartPointer<vtkProp> const&, int)'
/bin/ld: /usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:1334: undefined reference to `pcl::visualization::PCLVisualizer::convertToVtkMatrix(Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, vtkSmartPointer<vtkMatrix4x4>&)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `bool pcl::visualization::PCLVisualizer::addPointCloud<pcl::PointXYZ>(pcl::PointCloud<pcl::PointXYZ>::ConstPtr const&, pcl::visualization::PointCloudColorHandler<pcl::PointXYZ> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
/usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:146: undefined reference to `pcl::visualization::PointCloudGeometryHandlerXYZ<pcl::PointXYZ>::PointCloudGeometryHandlerXYZ(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `main':
/data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:125: undefined reference to `pcl::visualization::PCLVisualizer::PCLVisualizer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:129: undefined reference to `pcl::visualization::PCLVisualizer::createViewPort(double, double, double, double, int&)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:130: undefined reference to `pcl::visualization::PCLVisualizer::createViewPort(double, double, double, double, int&)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:151: undefined reference to `pcl::visualization::PCLVisualizer::addText(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int, double, double, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:152: undefined reference to `pcl::visualization::PCLVisualizer::addText(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int, double, double, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:157: undefined reference to `pcl::visualization::PCLVisualizer::addText(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int, double, double, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:160: undefined reference to `pcl::visualization::PCLVisualizer::setBackgroundColor(double const&, double const&, double const&, int)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:161: undefined reference to `pcl::visualization::PCLVisualizer::setBackgroundColor(double const&, double const&, double const&, int)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:164: undefined reference to `pcl::visualization::PCLVisualizer::setCameraPosition(double, double, double, double, double, double, int)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:165: undefined reference to `pcl::visualization::PCLVisualizer::setSize(int, int)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `pcl::visualization::PCLVisualizer::registerKeyboardCallback(void (*)(pcl::visualization::KeyboardEvent const&, void*), void*)':
/usr/include/pcl-1.10/pcl/visualization/pcl_visualizer.h:177: undefined reference to `pcl::visualization::PCLVisualizer::registerKeyboardCallback(std::function<void (pcl::visualization::KeyboardEvent const&)>)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `main':
/data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:171: undefined reference to `pcl::visualization::PCLVisualizer::wasStopped() const'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:173: undefined reference to `pcl::visualization::PCLVisualizer::spinOnce(int, bool)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:194: undefined reference to `pcl::visualization::PCLVisualizer::updateText(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int, double, double, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:125: undefined reference to `pcl::visualization::PCLVisualizer::~PCLVisualizer()'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:125: undefined reference to `pcl::visualization::PCLVisualizer::~PCLVisualizer()'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o:(.data.rel.ro._ZTVN3pcl13visualization28PointCloudGeometryHandlerXYZINS_8PointXYZEEE[_ZTVN3pcl13visualization28PointCloudGeometryHandlerXYZINS_8PointXYZEEE]+0x30): undefined reference to `pcl::visualization::PointCloudGeometryHandlerXYZ<pcl::PointXYZ>::getGeometry(vtkSmartPointer<vtkPoints>&) const'
collect2: error: ld returned 1 exit status
make[2]: *** [chapter10_tutorials/CMakeFiles/example.dir/build.make:366: /data0/alexFiles/pointcloudtest/devel/lib/chapter10_tutorials/example] Error 1
make[1]: *** [CMakeFiles/Makefile2:988: chapter10_tutorials/CMakeFiles/example.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Invoking "make -j40 -l40" failed
mvieth commented 1 year ago

Thanks, I tried find_package(PCL REQUIRED COMPONENTS common visualization io) , and it still reports the same problem, Could NOT find PCL xxx missing xxxxx, then undefined reference topcl::visualization::PCLVisualizer::updateCell`.

I got thefind_package(PCL COMPONENTS common visualization io REQUIRED) from https://github.com/kunaltyagi/pcl-cmake-minimum/blob/master/CMakeLists.txt It tells me that if pcl>1.9, you should use it and I actually used it.

Well, first REQUIRED, then COMPONENTS is definitely the right order, see: https://cmake.org/cmake/help/latest/command/find_package.html This might not solve the problem yet, but I would still recommend you to use this correct order! The note about PCL 1.9 is that you don't have to deal with ${PCL_INCLUDE_DIRS}. Using target_link_libraries is enough (like this target_link_libraries(pcl_demo ${PCL_LIBRARIES})). So for example, include_directories(${PCL_INCLUDE_DIRS}) in your CMakeLists.txt is not necessary.

Another thing is that I got the solution to similar problem #4472. But there is something different, and he just Copy files from /PCL/build/libs to /usr/local/libs. His PCL Type: Compiled from source successfully So how should I handle it? I can find all my files in /usr/lib/x86_64-linux-gnu/, e.g. /usr/lib/x86_64-linux-gnu/libpcl_visualization.so.1.10.0

Why it reported that Could NOT find PCL_xxxx (missing: PCL_xxxx_LIBRARY) ? Should I copy all the xxx.so files from/usr/lib/x86_64-linux-gnu/ to other place, e.g. /usr/local/libs ?

As I said, the directory /usr/local/libs is only relevant if you compile PCL from source. Since you don't compile from source, the other issue is probably not helpful for you. Can you run ls -lah /usr/lib/x86_64-linux-gnu/libpcl* ?

bigfacecat553 commented 1 year ago

As I said, the directory /usr/local/libs is only relevant if you compile PCL from source. Since you don't compile from source, the other issue is probably not helpful for you. Can you run ls -lah /usr/lib/x86_64-linux-gnu/libpcl* ?

Thanks, here are my results:

(base) alex@amax-Super-Server:~/Desktop$ ls -lan /usr/lib/x86_64-linux-gnu/libpcl*
lrwxrwxrwx 1 0 0 19 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_apps.so -> libpcl_apps.so.1.10
lrwxrwxrwx 1 1010 1010 21 9月 30 19:14 /usr/lib/x86_64-linux-gnu/libpcl_apps.so.1.10 -> libpcl_apps.so.1.10.0
-rw-r–r-- 1 1010 1010 1697952 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_apps.so.1.10.0
lrwxrwxrwx 1 0 0 21 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_common.so -> libpcl_common.so.1.10
lrwxrwxrwx 1 1010 1010 23 9月 30 19:15 /usr/lib/x86_64-linux-gnu/libpcl_common.so.1.10 -> libpcl_common.so.1.10.0
-rw-r–r-- 1 1010 1010 731328 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_common.so.1.10.0
lrwxrwxrwx 1 0 0 23 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_features.so -> libpcl_features.so.1.10
lrwxrwxrwx 1 1010 1010 25 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.10 -> libpcl_features.so.1.10.0
-rw-r–r-- 1 1010 1010 41391280 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_features.so.1.10.0
lrwxrwxrwx 1 0 0 22 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_filters.so -> libpcl_filters.so.1.10
lrwxrwxrwx 1 1010 1010 24 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_filters.so.1.10 -> libpcl_filters.so.1.10.0
-rw-r–r-- 1 1010 1010 8497336 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_filters.so.1.10.0
lrwxrwxrwx 1 0 0 21 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_io_ply.so -> libpcl_io_ply.so.1.10
lrwxrwxrwx 1 1010 1010 23 9月 30 19:11 /usr/lib/x86_64-linux-gnu/libpcl_io_ply.so.1.10 -> libpcl_io_ply.so.1.10.0
-rw-r–r-- 1 1010 1010 403792 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_io_ply.so.1.10.0
lrwxrwxrwx 1 0 0 17 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_io.so -> libpcl_io.so.1.10
lrwxrwxrwx 1 1010 1010 19 9月 30 19:11 /usr/lib/x86_64-linux-gnu/libpcl_io.so.1.10 -> libpcl_io.so.1.10.0
-rw-r–r-- 1 1010 1010 2640392 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_io.so.1.10.0
lrwxrwxrwx 1 0 0 21 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so -> libpcl_kdtree.so.1.10
lrwxrwxrwx 1 1010 1010 23 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so.1.10 -> libpcl_kdtree.so.1.10.0
-rw-r–r-- 1 1010 1010 1407200 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so.1.10.0
lrwxrwxrwx 1 0 0 24 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_keypoints.so -> libpcl_keypoints.so.1.10
lrwxrwxrwx 1 1010 1010 26 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_keypoints.so.1.10 -> libpcl_keypoints.so.1.10.0
-rw-r–r-- 1 1010 1010 1702056 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_keypoints.so.1.10.0
lrwxrwxrwx 1 0 0 17 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_ml.so -> libpcl_ml.so.1.10
lrwxrwxrwx 1 1010 1010 19 9月 30 19:12 /usr/lib/x86_64-linux-gnu/libpcl_ml.so.1.10 -> libpcl_ml.so.1.10.0
-rw-r–r-- 1 1010 1010 141488 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_ml.so.1.10.0
lrwxrwxrwx 1 0 0 21 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_octree.so -> libpcl_octree.so.1.10
lrwxrwxrwx 1 1010 1010 23 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_octree.so.1.10 -> libpcl_octree.so.1.10.0
-rw-r–r-- 1 1010 1010 2435232 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_octree.so.1.10.0
lrwxrwxrwx 1 0 0 24 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_outofcore.so -> libpcl_outofcore.so.1.10
lrwxrwxrwx 1 1010 1010 26 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_outofcore.so.1.10 -> libpcl_outofcore.so.1.10.0
-rw-r–r-- 1 1010 1010 84144 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_outofcore.so.1.10.0
lrwxrwxrwx 1 0 0 21 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_people.so -> libpcl_people.so.1.10
lrwxrwxrwx 1 1010 1010 23 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_people.so.1.10 -> libpcl_people.so.1.10.0
-rw-r–r-- 1 1010 1010 22600 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_people.so.1.10.0
lrwxrwxrwx 1 0 0 26 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_recognition.so -> libpcl_recognition.so.1.10
lrwxrwxrwx 1 1010 1010 28 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.10 -> libpcl_recognition.so.1.10.0
-rw-r–r-- 1 1010 1010 4880560 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.10.0
lrwxrwxrwx 1 0 0 27 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_registration.so -> libpcl_registration.so.1.10
lrwxrwxrwx 1 1010 1010 29 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_registration.so.1.10 -> libpcl_registration.so.1.10.0
-rw-r–r-- 1 1010 1010 1997040 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_registration.so.1.10.0
lrwxrwxrwx 1 0 0 31 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_sample_consensus.so -> libpcl_sample_consensus.so.1.10
lrwxrwxrwx 1 1010 1010 33 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_sample_consensus.so.1.10 -> libpcl_sample_consensus.so.1.10.0
-rw-r–r-- 1 1010 1010 13568288 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_sample_consensus.so.1.10.0
lrwxrwxrwx 1 0 0 21 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_search.so -> libpcl_search.so.1.10
lrwxrwxrwx 1 1010 1010 23 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_search.so.1.10 -> libpcl_search.so.1.10.0
-rw-r–r-- 1 1010 1010 2291872 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_search.so.1.10.0
lrwxrwxrwx 1 0 0 27 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_segmentation.so -> libpcl_segmentation.so.1.10
lrwxrwxrwx 1 1010 1010 29 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_segmentation.so.1.10 -> libpcl_segmentation.so.1.10.0
-rw-r–r-- 1 1010 1010 14125288 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_segmentation.so.1.10.0
lrwxrwxrwx 1 0 0 21 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_stereo.so -> libpcl_stereo.so.1.10
lrwxrwxrwx 1 1010 1010 23 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_stereo.so.1.10 -> libpcl_stereo.so.1.10.0
-rw-r–r-- 1 1010 1010 243872 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_stereo.so.1.10.0
lrwxrwxrwx 1 0 0 22 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_surface.so -> libpcl_surface.so.1.10
lrwxrwxrwx 1 1010 1010 24 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_surface.so.1.10 -> libpcl_surface.so.1.10.0
-rw-r–r-- 1 1010 1010 14207144 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_surface.so.1.10.0
lrwxrwxrwx 1 0 0 23 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_tracking.so -> libpcl_tracking.so.1.10
lrwxrwxrwx 1 1010 1010 25 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_tracking.so.1.10 -> libpcl_tracking.so.1.10.0
-rw-r–r-- 1 1010 1010 3934368 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_tracking.so.1.10.0
lrwxrwxrwx 1 0 0 28 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_visualization.so -> libpcl_visualization.so.1.10
lrwxrwxrwx 1 1010 1010 30 9月 30 19:30 /usr/lib/x86_64-linux-gnu/libpcl_visualization.so.1.10 -> libpcl_visualization.so.1.10.0
-rw-r–r-- 1 1010 1010 1514856 2月 6 2020 /usr/lib/x86_64-linux-gnu/libpcl_visualization.so.1.10.0
mvieth commented 1 year ago

Okay, can you also run ls -lah /usr and ls -lah /usr/lib ?

bigfacecat553 commented 1 year ago

Okay, can you also run ls -lah /usr and ls -lah /usr/lib ? well, here are results

(base) alex@amax-Super-Server:~/Desktop$ ls -lan /usr
total 180
drwxr-xr-x  15 0 0  4096 9月  14  2021 .
drwxr-xr-x  22 0 0  4096 9月  15  2021 ..
drwxr-xr-x   2 0 0 69632 10月  5 12:17 bin
drwxr-xr-x   2 0 0  4096 8月  19  2021 games
drwxr-xr-x 169 0 0 16384 9月  30 18:59 include
drwxr-xr-x 142 0 0 12288 9月  18 20:18 lib
drwxr-xr-x   2 0 0  4096 9月  14  2021 lib32
drwxr-xr-x   2 0 0  4096 6月  23 20:30 lib64
drwxr-xr-x  13 0 0 12288 6月  23 20:31 libexec
drwxr-xr-x   2 0 0  4096 8月  19  2021 libx32
drwxr-xr-x  14 0 0  4096 9月  24 10:22 local
drwxr-xr-x   9 0 0  4096 9月  14  2021 pycharm-2021.2.1
drwxr-xr-x   2 0 0 20480 9月  29 06:10 sbin
drwxr-xr-x 321 0 0 12288 9月  30 11:01 share
drwxr-xr-x  12 0 0  4096 9月  21 06:37 src
(base) alex@amax-Super-Server:~/Desktop$ ls -lan /usr/lib
total 82072
drwxr-xr-x 142 0 0    12288 9月  18 20:18 .
drwxr-xr-x  15 0 0     4096 9月  14  2021 ..
drwxr-xr-x   2 0 0     4096 11月 18  2021 accountsservice
drwxr-xr-x   2 0 0     4096 8月  19  2021 apg
drwxr-xr-x   2 0 0     4096 8月  19  2021 apparmor
drwxr-xr-x   5 0 0     4096 6月  23 20:31 apt
drwxr-xr-x   3 0 0     4096 8月  19  2021 aspell
drwxr-xr-x   2 0 0     4096 9月  14  2021 bfd-plugins
drwxr-xr-x   2 0 0     4096 4月  22  2020 binfmt.d
drwxr-xr-x   2 0 0     4096 9月  18 20:16 binfmt-support
drwxr-xr-x   2 0 0     4096 9月  18 20:16 blt2.5
drwxr-xr-x   2 0 0     4096 6月  16 06:42 bluetooth
drwxr-xr-x   2 0 0     4096 8月  19  2021 bolt
drwxr-xr-x   2 0 0     4096 8月  19  2021 brltty
drwxr-xr-x   5 0 0     4096 9月  18 20:17 cmake
-rwxr-xr-x   1 0 0      739 2月  15  2022 cnf-update-db
-rwxr-xr-x   1 0 0     3565 2月  15  2022 command-not-found
drwxr-xr-x   2 0 0     4096 10月 27  2021 compat-ld
drwxr-xr-x   2 0 0     4096 8月  19  2021 console-setup
lrwxrwxrwx   1 0 0       21 9月  14  2021 cpp -> /etc/alternatives/cpp
drwxr-xr-x   3 0 0     4096 7月  28 06:10 crda
drwxr-xr-x  10 0 0     4096 8月  19  2021 cups
drwxr-xr-x   2 0 0     4096 5月  10 07:00 dbus-1.0
drwxr-xr-x   3 0 0     4096 6月  23 20:30 debug
drwxr-xr-x   2 0 0     4096 9月  14  2021 dkms
drwxr-xr-x   3 0 0     4096 8月  19  2021 dpkg
drwxr-xr-x   2 0 0     4096 8月  19  2021 eject
drwxr-xr-x   3 0 0     4096 8月  19  2021 emacsen-common
drwxr-xr-x   2 0 0     4096 6月  23 20:31 environment.d
drwxr-xr-x   7 0 0     4096 8月  19  2021 evolution-data-server
drwxr-xr-x   2 0 0     4096 8月  19  2021 file
drwxr-xr-x   7 0 0     4096 10月  1 06:15 firefox
drwxr-xr-x   5 0 0     4096 8月  19  2021 firefox-addons
drwxr-xr-x  91 0 0    36864 7月  28 06:10 firmware
drwxr-xr-x   2 0 0     4096 9月  18 20:16 fltk
drwxr-xr-x   3 0 0     4096 8月  19  2021 gcc
drwxr-xr-x   2 0 0     4096 8月  19  2021 gdm3
drwxr-xr-x   2 0 0     4096 9月  18 20:16 gettext
drwxr-xr-x   3 0 0     4096 8月  19  2021 ghostscript
drwxr-xr-x   2 0 0     4096 11月 18  2021 girepository-1.0
drwxr-xr-x   3 0 0    20480 7月  15 06:13 git-core
drwxr-xr-x   2 0 0     4096 8月  19  2021 gnome-initial-setup
drwxr-xr-x   2 0 0     4096 8月  19  2021 gnome-session
drwxr-xr-x   3 0 0     4096 8月  19  2021 gnome-settings-daemon-3.0
drwxr-xr-x   3 0 0     4096 8月  19  2021 gnome-shell
drwxr-xr-x   2 0 0     4096 7月   7 06:02 gnupg
drwxr-xr-x   2 0 0     4096 7月   7 06:02 gnupg2
drwxr-xr-x   2 0 0     4096 10月 27  2021 gold-ld
drwxr-xr-x   4 0 0     4096 8月  19  2021 groff
drwxr-xr-x   5 0 0     4096 4月   8 07:07 grub
drwxr-xr-x   2 0 0     4096 4月   8 07:07 grub-legacy
lrwxrwxrwx   1 0 0       31 9月  14  2021 gst-install-plugins-helper -> packagekit/pk-gstreamer-install
drwxr-xr-x   2 0 0     4096 6月  23 20:31 gvfs
drwxr-xr-x   2 0 0     4096 8月  19  2021 hdparm
drwxr-xr-x   6 0 0    12288 9月  16 06:33 i386-linux-gnu
drwxr-xr-x   2 0 0     4096 9月  15  2021 ibus
drwxr-xr-x   2 0 0     4096 8月  19  2021 init
drwxr-xr-x   4 0 0     4096 8月  19  2021 initramfs-tools
drwxr-xr-x   2 0 0     4096 8月  19  2021 ispell
drwxr-xr-x   2 0 0     4096 9月  18 20:17 jni
drwxr-xr-x   3 0 0     4096 8月  19  2021 kernel
drwxr-xr-x   3 0 0     4096 8月  19  2021 klibc
-rwxr-xr-x   1 0 0    78784 4月  13 16:40 klibc-abS-oVB3xeRN8SFypUWbQvR33nc.so
drwxr-xr-x   2 0 0     4096 8月  19  2021 language-selector
lrwxrwxrwx   1 0 0       25 4月   7 09:24 ld-linux.so.2 -> i386-linux-gnu/ld-2.31.so
lrwxrwxrwx   1 0 0       17 3月  23  2020 libarmadillo.so -> libarmadillo.so.9
lrwxrwxrwx   1 0 0       23 3月  23  2020 libarmadillo.so.9 -> libarmadillo.so.9.800.4
-rw-r--r--   1 0 0    73616 3月  23  2020 libarmadillo.so.9.800.4
-rw-r--r--   1 0 0  1468608 1月  30  2018 libBLT.2.5.so.8.6
-rw-r--r--   1 0 0   316144 1月  30  2018 libBLTlite.2.5.so.8.6
-rw-r--r--   1 0 0  1120672 4月  10  2020 libdfalt.a
-rw-r--r--   1 0 0      933 4月  10  2020 libdfalt.la
lrwxrwxrwx   1 0 0       17 4月  10  2020 libdfalt.so -> libdfalt.so.0.0.0
lrwxrwxrwx   1 0 0       17 4月  10  2020 libdfalt.so.0 -> libdfalt.so.0.0.0
-rw-r--r--   1 0 0   503888 4月  10  2020 libdfalt.so.0.0.0
-rw-r--r--   1 0 0 50018498 3月  30  2020 libgdal.a
lrwxrwxrwx   1 0 0       17 3月  30  2020 libgdal.so -> libgdal.so.26.0.4
lrwxrwxrwx   1 0 0       17 3月  30  2020 libgdal.so.26 -> libgdal.so.26.0.4
-rw-r--r--   1 0 0 20197488 3月  30  2020 libgdal.so.26.0.4
-rw-r--r--   1 0 0     1133 4月  10  2020 libhdf4.settings
drwxr-xr-x   2 0 0     4096 9月  14  2021 libmbim
-rw-r--r--   1 0 0   274934 4月  10  2020 libmfhdfalt.a
-rw-r--r--   1 0 0      954 4月  10  2020 libmfhdfalt.la
lrwxrwxrwx   1 0 0       20 4月  10  2020 libmfhdfalt.so -> libmfhdfalt.so.0.0.0
lrwxrwxrwx   1 0 0       20 4月  10  2020 libmfhdfalt.so.0 -> libmfhdfalt.so.0.0.0
-rw-r--r--   1 0 0   161888 4月  10  2020 libmfhdfalt.so.0.0.0
lrwxrwxrwx   1 0 0       17 3月  24  2020 libnimCodecs.so -> libnimCodecs.so.0
-rw-r--r--   1 0 0   121680 3月  24  2020 libnimCodecs.so.0
lrwxrwxrwx   1 0 0       20 3月  24  2020 libnimMockNodes.so -> libnimMockNodes.so.0
-rw-r--r--   1 0 0   252696 3月  24  2020 libnimMockNodes.so.0
lrwxrwxrwx   1 0 0       19 3月  24  2020 libnimRecorder.so -> libnimRecorder.so.0
-rw-r--r--   1 0 0   146256 3月  24  2020 libnimRecorder.so.0
-rw-r--r--   1 0 0    15344 8月  24  2021 libnss_passwdaliases.so.2
-rw-r--r--   1 0 0  1375912 1月  18  2022 libnvidia-gtk2.so.470.57.01
-rw-r--r--   1 0 0  1384584 1月  18  2022 libnvidia-gtk3.so.470.57.01
lrwxrwxrwx   1 0 0       14 9月   5  2019 libogdi.so -> libogdi.so.4.1
lrwxrwxrwx   1 0 0       14 9月   5  2019 libogdi.so.4 -> libogdi.so.4.1
-rw-r--r--   1 0 0   109000 9月   5  2019 libogdi.so.4.1
lrwxrwxrwx   1 0 0       15 3月  24  2020 libOpenNI2.so -> libOpenNI2.so.0
-rw-r--r--   1 0 0   277856 3月  24  2020 libOpenNI2.so.0
lrwxrwxrwx   1 0 0       18 3月  24  2020 libOpenNI.jni.so -> libOpenNI.jni.so.0
-rw-r--r--   1 0 0   180528 3月  24  2020 libOpenNI.jni.so.0
drwxr-xr-x   2 0 0     4096 9月  18 20:17 libopenni-sensor-primesense0
lrwxrwxrwx   1 0 0       14 3月  24  2020 libOpenNI.so -> libOpenNI.so.0
-rw-r--r--   1 0 0   525016 3月  24  2020 libOpenNI.so.0
lrwxrwxrwx   1 0 0       20 4月  10  2020 liborocos-kdl.so -> liborocos-kdl.so.1.4
lrwxrwxrwx   1 0 0       22 4月  10  2020 liborocos-kdl.so.1.4 -> liborocos-kdl.so.1.4.0
-rw-r--r--   1 0 0   780464 4月  10  2020 liborocos-kdl.so.1.4.0
drwxr-xr-x   2 0 0     4096 9月  18 20:16 libpsm1
drwxr-xr-x   2 0 0     4096 11月 26  2021 libqmi
lrwxrwxrwx   1 0 0       19 3月  22  2020 libqwt-qt5.so -> libqwt-qt5.so.6.1.4
lrwxrwxrwx   1 0 0       19 3月  22  2020 libqwt-qt5.so.6 -> libqwt-qt5.so.6.1.4
lrwxrwxrwx   1 0 0       19 3月  22  2020 libqwt-qt5.so.6.1 -> libqwt-qt5.so.6.1.4
-rw-r--r--   1 0 0  1426152 3月  22  2020 libqwt-qt5.so.6.1.4
drwxr-xr-x   5 0 0     4096 3月  17  2022 libreoffice
lrwxrwxrwx   1 0 0       29 3月  24  2020 libSample-NiSampleModule.so -> libSample-NiSampleModule.so.0
-rw-r--r--   1 0 0    88712 3月  24  2020 libSample-NiSampleModule.so.0
lrwxrwxrwx   1 0 0       15 5月  21  2015 libspnav.so.0 -> libspnav.so.0.1
-rw-r--r--   1 0 0    14480 5月  21  2015 libspnav.so.0.1
lrwxrwxrwx   1 0 0       13 9月   5  2019 libvpf.so -> libvpf.so.4.1
lrwxrwxrwx   1 0 0       13 9月   5  2019 libvpf.so.4 -> libvpf.so.4.1
-rw-r--r--   1 0 0   293296 9月   5  2019 libvpf.so.4.1
-rw-r--r--   1 0 0   555852 2月  20  2020 libvtkWrappingTools-7.1.a
-rw-r--r--   1 0 0    19048 3月  22  2020 libXnCore.so.0
-rw-r--r--   1 0 0   341872 3月  22  2020 libXnDDK.so.0
-rw-r--r--   1 0 0   212536 3月  22  2020 libXnDeviceFile.so.0
-rw-r--r--   1 0 0   639864 3月  22  2020 libXnDeviceSensorV2.so.0
-rw-r--r--   1 0 0    32000 3月  22  2020 libXnFormats.so.0
drwxr-xr-x   3 0 0     4096 8月  19  2021 linux
drwxr-xr-x   3 0 0     4096 8月  19  2021 linux-boot-probes
drwxr-xr-x   2 0 0     4096 8月  19  2021 linux-sound-base
drwxr-xr-x   3 0 0     4096 9月  18 20:16 llvm-10
drwxr-xr-x   3 0 0     4096 6月  23 20:32 locale
drwxr-xr-x   2 0 0     4096 8月  19  2021 lp_solve
drwxr-xr-x   3 0 0     4096 8月  19  2021 lsb
drwxr-xr-x   2 0 0     4096 8月  19  2021 man-db
drwxr-xr-x   2 0 0     4096 8月  19  2021 memtest86+
drwxr-xr-x   3 0 0     4096 8月  19  2021 mime
drwxr-xr-x   2 0 0     4096 9月  21 06:36 modprobe.d
drwxr-xr-x  29 0 0     4096 9月  21 06:35 modules
drwxr-xr-x   2 0 0     4096 9月  17 15:37 modules-load.d
drwxr-xr-x   2 0 0     4096 4月   8 07:06 netplan
drwxr-xr-x   8 0 0     4096 8月  19  2021 networkd-dispatcher
drwxr-xr-x   6 0 0     4096 2月  21  2022 NetworkManager
drwxr-xr-x   2 0 0     4096 6月  23 20:31 nvidia
drwxr-xr-x   2 0 0     4096 9月  18 20:16 ogdi
drwxr-xr-x   3 0 0     4096 9月  18 20:17 OpenNI2
drwxr-xr-x   2 0 0     4096 6月  23 20:31 openssh
lrwxrwxrwx   1 0 0       30 8月  16 21:23 open-vm-tools -> x86_64-linux-gnu/open-vm-tools
drwxr-xr-x   2 0 0     4096 8月  19  2021 os-prober
drwxr-xr-x   4 0 0     4096 9月  14  2021 os-probes
-rw-r--r--   1 0 0      382 2月  17  2022 os-release
drwxr-xr-x   2 0 0     4096 8月  19  2021 packagekit
drwxr-xr-x   2 0 0     4096 8月  19  2021 pcmciautils
drwxr-xr-x   2 0 0     4096 9月  18 20:17 pkgconfig
-rw-r--r--   1 0 0       17 2月   7  2020 pkg-config.multiarch
drwxr-xr-x   4 0 0     4096 8月  19  2021 pm-utils
drwxr-xr-x   2 0 0     4096 3月   1  2022 policykit-1
drwxr-xr-x   3 0 0     4096 11月 26  2021 postfix
drwxr-xr-x   3 0 0     4096 8月  19  2021 pppd
drwxr-xr-x   3 0 0     4096 8月  19  2021 pulse-13.99.1
drwxr-xr-x  27 0 0    20480 9月  30 15:17 python2.7
drwxr-xr-x   3 0 0     4096 8月  19  2021 python3
drwxr-xr-x  31 0 0    20480 9月  18 20:17 python3.8
drwxr-xr-x   6 0 0     4096 9月  18 20:17 python3.9
drwxr-xr-x   3 0 0     4096 9月  18 20:15 qt5
drwxr-xr-x   3 0 0     4096 8月  19  2021 recovery-mode
drwxr-xr-x   3 0 0     4096 8月  19  2021 rhythmbox
drwxr-xr-x   2 0 0     4096 5月   7 06:15 rsyslog
drwxr-xr-x   6 0 0     4096 9月  18 20:17 ruby
drwxr-xr-x   2 0 0     4096 8月  19  2021 rygel
drwxr-xr-x   2 0 0     4096 12月 26  2019 sasl2
drwxr-xr-x   3 0 0     4096 9月  18 20:17 sbcl
lrwxrwxrwx   1 0 0       16 9月   7  2021 sendmail -> ../sbin/sendmail
lrwxrwxrwx   1 0 0       19 3月  30  2022 sftp-server -> openssh/sftp-server
drwxr-xr-x   3 0 0     4096 9月  14  2021 shim
drwxr-xr-x   3 0 0     4096 8月  19  2021 shotwell
drwxr-xr-x   2 0 0     4096 6月  23 20:31 snapd
drwxr-xr-x   2 0 0     4096 2月  21  2022 software-properties
drwxr-xr-x   2 0 0     4096 8月  19  2021 speech-dispatcher-modules
drwxr-xr-x   3 0 0     4096 7月   7 06:02 ssl
drwxr-xr-x   2 0 0     4096 8月  19  2021 sudo
drwxr-xr-x   2 0 0     4096 6月  23 20:31 sysctl.d
drwxr-xr-x   4 0 0     4096 8月  19  2021 syslinux
drwxr-xr-x   2 0 0     4096 8月  19  2021 SYSLINUX
drwxr-xr-x   2 0 0     4096 8月  19  2021 syslinux-legacy
drwxr-xr-x  18 0 0    12288 6月  23 20:31 systemd
drwxr-xr-x   2 0 0     4096 6月  23 20:31 sysusers.d
drwxr-xr-x   2 0 0     4096 8月  19  2021 tc
drwxr-xr-x   2 0 0     4096 9月  18 20:17 tcl8.6
lrwxrwxrwx   1 0 0       19 2月  24  2019 tclConfig.sh -> tcl8.6/tclConfig.sh
lrwxrwxrwx   1 0 0       21 2月  24  2019 tclooConfig.sh -> tcl8.6/tclooConfig.sh
drwxr-xr-x   4 0 0     4096 9月  18 20:17 tcltk
drwxr-xr-x  16 0 0     4096 2月  26  2020 terminfo
drwxr-xr-x   7 0 0     4096 7月  15 06:12 thunderbird
drwxr-xr-x   6 0 0     4096 8月  19  2021 thunderbird-addons
drwxr-xr-x   2 0 0     4096 9月  18 20:17 tk8.6
lrwxrwxrwx   1 0 0       17 2月  24  2019 tkConfig.sh -> tk8.6/tkConfig.sh
drwxr-xr-x   2 0 0     4096 9月  17 15:37 tmpfiles.d
drwxr-xr-x   4 0 0     4096 9月  14  2021 ubiquity
drwxr-xr-x   2 0 0     4096 6月  23 20:31 ubuntu-advantage
drwxr-xr-x   2 0 0     4096 5月   5 19:17 ubuntu-release-upgrader
drwxr-xr-x   4 0 0     4096 6月  23 20:33 udev
drwxr-xr-x   2 0 0     4096 9月  23  2021 udisks2
drwxr-xr-x   2 0 0     4096 11月 26  2021 ufw
drwxr-xr-x   3 0 0     4096 8月  19  2021 unity-settings-daemon-1.0
drwxr-xr-x   2 0 0     4096 2月  21  2022 update-notifier
drwxr-xr-x   2 0 0     4096 8月  19  2021 upower
drwxr-xr-x   2 0 0     4096 9月  18 20:23 valgrind
drwxr-xr-x   2 0 0     4096 8月  19  2021 vino
drwxr-xr-x   4 0 0     4096 8月  19  2021 X11
drwxr-xr-x 130 0 0   249856 10月  5 12:15 x86_64-linux-gnu
drwxr-xr-x   3 0 0     4096 7月  14 06:17 xorg
drwxr-xr-x   2 0 0     4096 8月  19  2021 xserver-xorg-video-intel
bigfacecat553 commented 1 year ago

It seems that I just can't use anything about pcl::visualization:: If I remove theexample file containing pcl::visualization::, and then run catkin_make Although it reports warning, it get 100% successful.

-- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so)
-- OpenNI2 found (include: /usr/include/openni2, lib: /usr/lib/libOpenNI2.so)
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
** WARNING ** io features related to libusb-1.0 will be disabled
-- looking for PCL_COMMON
-- Could NOT find PCL_COMMON (missing: PCL_COMMON_LIBRARY) 
-- looking for PCL_KDTREE
-- Could NOT find PCL_KDTREE (missing: PCL_KDTREE_LIBRARY) 
-- looking for PCL_GEOMETRY
-- looking for PCL_OCTREE
-- Could NOT find PCL_OCTREE (missing: PCL_OCTREE_LIBRARY) 
-- looking for PCL_SEARCH
-- Could NOT find PCL_SEARCH (missing: PCL_SEARCH_LIBRARY) 
-- looking for PCL_VISUALIZATION
-- Could NOT find PCL_VISUALIZATION (missing: PCL_VISUALIZATION_LIBRARY) 
-- looking for PCL_IO
-- Could NOT find PCL_IO (missing: PCL_IO_LIBRARY) 
-- Configuring done
-- Generating done
-- Build files have been written to: /data0/alexFiles/pointcloudtest/build
####
#### Running command: "make -j40 -l40" in "/data0/alexFiles/pointcloudtest/build"
####
[ 10%] Built target pcl_model_estimation
[ 20%] Built target pcl_visualize
[ 30%] Built target pcl_matching
[ 40%] Built target pcl_write
[ 50%] Built target pcl_downsampling
[ 60%] Built target pcl_read
[ 70%] Built target pcl_partitioning
[ 80%] Built target pcl_create
[ 90%] Built target pcl_filter
[100%] Built target pcl_planar_segmentation
mvieth commented 1 year ago

Can you put this in your CMakeLists.txt after the find_package call to PCL: message("PCL_INCLUDE_DIRS=${PCL_INCLUDE_DIRS}, PCL_LIBRARY_DIRS=${PCL_LIBRARY_DIRS}, PCL_LIBRARIES=${PCL_LIBRARIES}")

bigfacecat553 commented 1 year ago

Can you put this in your CMakeLists.txt after the find_package call to PCL: message("PCL_INCLUDE_DIRS=${PCL_INCLUDE_DIRS}, PCL_LIBRARY_DIRS=${PCL_LIBRARY_DIRS}, PCL_LIBRARIES=${PCL_LIBRARIES}")

Here are the results PCL_INCLUDE_DIRS=/lib/x86_64-linux-gnu/cmake/pcl/include, PCL_LIBRARY_DIRS=/lib/x86_64-linux-gnu/cmake/pcl/lib/x86_64-linux-gnu, PCL_LIBRARIES=/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_regex.so;/usr/lib/libOpenNI.so;/usr/lib/libOpenNI2.so;vtkChartsCore;vtkCommonColor;vtkCommonCore;vtksys;vtkCommonDataModel;vtkCommonMath;vtkCommonMisc;vtkCommonSystem;vtkCommonTransforms;vtkCommonExecutionModel;vtkFiltersGeneral;vtkCommonComputationalGeometry;vtkFiltersCore;vtkInfovisCore;vtkFiltersExtraction;vtkFiltersStatistics;vtkImagingFourier;vtkImagingCore;vtkalglib;vtkRenderingContext2D;vtkRenderingCore;vtkFiltersGeometry;vtkFiltersSources;vtkRenderingFreeType;/usr/lib/x86_64-linux-gnu/libfreetype.so;/usr/lib/x86_64-linux-gnu/libz.so;vtkFiltersModeling;vtkImagingSources;vtkInteractionStyle;vtkInteractionWidgets;vtkFiltersHybrid;vtkImagingColor;vtkImagingGeneral;vtkImagingHybrid;vtkIOImage;vtkDICOMParser;vtkmetaio;/usr/lib/x86_64-linux-gnu/libjpeg.so;/usr/lib/x86_64-linux-gnu/libpng.so;/usr/lib/x86_64-linux-gnu/libtiff.so;vtkRenderingAnnotation;vtkRenderingVolume;vtkIOXML;vtkIOCore;vtkIOXMLParser;/usr/lib/x86_64-linux-gnu/libexpat.so;vtkIOGeometry;vtkIOLegacy;vtkIOPLY;vtkRenderingLOD;vtkViewsContext2D;vtkViewsCore;vtkRenderingContextOpenGL2;vtkRenderingOpenGL2;FLANN::FLANN

mvieth commented 1 year ago

That's strange. Can you search for the file PCLConfig.cmake and uncomment/activate all pcl_message calls (should be four), then run catkin_make again? So it says that the includes are in /lib/x86_64-linux-gnu/cmake/pcl/include. Did you put them there or did apt do that? Usually they would be in /usr/include/pcl-1.10. What does ls -lah /usr/include/pcl-1.10/pcl/pcl_config.h return?

bigfacecat553 commented 1 year ago

So it says that the includes are in /lib/x86_64-linux-gnu/cmake/pcl/include. Did you put them there or did apt do that? Usually they would be in /usr/include/pcl-1.10.

About this, you can get more details from https://github.com/ouster-lidar/ouster_example/issues/314. I used to get the problem:

CMake Error at /lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:62 (message):
  PCL can not be found on this machine

And I solved it by:

When compiling the ouster_ros package on a clean Ubuntu 20.04, I get the error

-- ==> add_subdirectory(ouster_lidar/ouster_ros) CMake Error at /lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake:62 (message): PCL can not be found on this machine

Looks like this is an issue with PCL itself which can be fixed with

sudo mkdir /lib/x86_64-linux-gnu/cmake/pcl/include sudo ln -s /usr/include/pcl-1.10/pcl /lib/x86_64-linux-gnu/cmake/pcl/include/pcl

Perhaps you can fix it upstream or include the workaround in your README. Thanks!

bigfacecat553 commented 1 year ago

That's strange. Can you search for the file PCLConfig.cmake .What does ls -lah /usr/include/pcl-1.10/pcl/pcl_config.h return?

here are results:

(base) alex@amax-Super-Server:~/Desktop$ locate PCLConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/pcl/PCLConfig.cmake
(base) alex@amax-Super-Server:~/Desktop$ locate pcl_config.h
/usr/include/pcl-1.10/pcl/pcl_config.h
(base) alex@amax-Super-Server:~/Desktop$ ls -lan /usr/include/pcl-1.10/pcl/pcl_config.h
-rw-r--r-- 1 0 0 2264 2月   6  2020 /usr/include/pcl-1.10/pcl/pcl_config.h
bigfacecat553 commented 1 year ago

That's strange. Can you search for the file PCLConfig.cmake and uncomment/activate all pcl_message calls (should be four), then run catkin_make again?

I uncomment/activate the fourpcl_messagecalls

# pcl_message("Found a PCL installation")
# pcl_message("Found a PCL installation")
# pcl_message("PCL found into a build tree.")
#pcl_message("No include directory found for pcl_${component}.")

then:

(base) alex@amax-Super-Server:/data0/alexFiles/pointcloudtest$ catkin_make
Base path: /data0/alexFiles/pointcloudtest
Source space: /data0/alexFiles/pointcloudtest/src
Build space: /data0/alexFiles/pointcloudtest/build
Devel space: /data0/alexFiles/pointcloudtest/devel
Install space: /data0/alexFiles/pointcloudtest/install
####
#### Running command: "make cmake_check_build_system" in "/data0/alexFiles/pointcloudtest/build"
####
-- Using CATKIN_DEVEL_PREFIX: /data0/alexFiles/pointcloudtest/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/noetic
-- This workspace overlays: /opt/ros/noetic
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Using Debian Python package layout
-- Using empy: /usr/lib/python3/dist-packages/em.py
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /data0/alexFiles/pointcloudtest/build/test_results
-- Forcing gtest/gmock from source, though one was otherwise available.
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python3 (found version "3.8.10") 
-- Using Python nosetests: /bin/nosetests3
-- catkin 0.8.10
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - chapter10_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'chapter10_tutorials'
-- ==> add_subdirectory(chapter10_tutorials)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
PCL found into a build tree.
-- Eigen found (include: /usr/include/eigen3, version: 3.3.7)
-- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so)
-- OpenNI2 found (include: /usr/include/openni2, lib: /usr/lib/libOpenNI2.so)
-- The imported target "vtkParseOGLExt" references the file
   "/usr/bin/vtkParseOGLExt-7.1"
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-7.1/VTKTargets.cmake"
but not all the files it references.

-- 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-7.1/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
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-7.1/VTKTargets.cmake"
but not all the files it references.

-- The imported target "pvtk" references the file
   "/usr/bin/pvtk"
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-7.1/VTKTargets.cmake"
but not all the files it references.

-- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so)
-- OpenNI2 found (include: /usr/include/openni2, lib: /usr/lib/libOpenNI2.so)
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
** WARNING ** io features related to libusb-1.0 will be disabled
-- looking for PCL_COMMON
-- Could NOT find PCL_COMMON (missing: PCL_COMMON_LIBRARY) 
-- looking for PCL_KDTREE
-- Could NOT find PCL_KDTREE (missing: PCL_KDTREE_LIBRARY) 
-- looking for PCL_GEOMETRY
-- looking for PCL_OCTREE
-- Could NOT find PCL_OCTREE (missing: PCL_OCTREE_LIBRARY) 
-- looking for PCL_SEARCH
-- Could NOT find PCL_SEARCH (missing: PCL_SEARCH_LIBRARY) 
-- looking for PCL_VISUALIZATION
-- Could NOT find PCL_VISUALIZATION (missing: PCL_VISUALIZATION_LIBRARY) 
-- looking for PCL_IO
-- Could NOT find PCL_IO (missing: PCL_IO_LIBRARY) 
PCL_INCLUDE_DIRS=/lib/x86_64-linux-gnu/cmake/pcl/include, PCL_LIBRARY_DIRS=/lib/x86_64-linux-gnu/cmake/pcl/lib/x86_64-linux-gnu, PCL_LIBRARIES=/usr/lib/x86_64-linux-gnu/libboost_system.so;/usr/lib/x86_64-linux-gnu/libboost_filesystem.so;/usr/lib/x86_64-linux-gnu/libboost_date_time.so;/usr/lib/x86_64-linux-gnu/libboost_iostreams.so;/usr/lib/x86_64-linux-gnu/libboost_regex.so;/usr/lib/libOpenNI.so;/usr/lib/libOpenNI2.so;vtkChartsCore;vtkCommonColor;vtkCommonCore;vtksys;vtkCommonDataModel;vtkCommonMath;vtkCommonMisc;vtkCommonSystem;vtkCommonTransforms;vtkCommonExecutionModel;vtkFiltersGeneral;vtkCommonComputationalGeometry;vtkFiltersCore;vtkInfovisCore;vtkFiltersExtraction;vtkFiltersStatistics;vtkImagingFourier;vtkImagingCore;vtkalglib;vtkRenderingContext2D;vtkRenderingCore;vtkFiltersGeometry;vtkFiltersSources;vtkRenderingFreeType;/usr/lib/x86_64-linux-gnu/libfreetype.so;/usr/lib/x86_64-linux-gnu/libz.so;vtkFiltersModeling;vtkImagingSources;vtkInteractionStyle;vtkInteractionWidgets;vtkFiltersHybrid;vtkImagingColor;vtkImagingGeneral;vtkImagingHybrid;vtkIOImage;vtkDICOMParser;vtkmetaio;/usr/lib/x86_64-linux-gnu/libjpeg.so;/usr/lib/x86_64-linux-gnu/libpng.so;/usr/lib/x86_64-linux-gnu/libtiff.so;vtkRenderingAnnotation;vtkRenderingVolume;vtkIOXML;vtkIOCore;vtkIOXMLParser;/usr/lib/x86_64-linux-gnu/libexpat.so;vtkIOGeometry;vtkIOLegacy;vtkIOPLY;vtkRenderingLOD;vtkViewsContext2D;vtkViewsCore;vtkRenderingContextOpenGL2;vtkRenderingOpenGL2;FLANN::FLANN
-- Configuring done
-- Generating done
-- Build files have been written to: /data0/alexFiles/pointcloudtest/build
####
#### Running command: "make -j40 -l40" in "/data0/alexFiles/pointcloudtest/build"
####
[  9%] Built target pcl_create
[ 18%] Built target pcl_matching
[ 27%] Built target pcl_filter
[ 36%] Built target pcl_partitioning
[ 45%] Built target pcl_read
[ 54%] Built target pcl_planar_segmentation
[ 63%] Built target pcl_model_estimation
[ 72%] Built target pcl_write
[ 81%] Built target pcl_downsampling
[ 90%] Built target pcl_visualize
[ 95%] Linking CXX executable example
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `void pcl::visualization::PCLVisualizer::convertPointCloudToVTKPolyData<pcl::PointXYZ>(pcl::visualization::PointCloudGeometryHandler<pcl::PointXYZ> const&, vtkSmartPointer<vtkPolyData>&, vtkSmartPointer<vtkIdTypeArray>&)':
/usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:307: undefined reference to `pcl::visualization::PCLVisualizer::updateCells(vtkSmartPointer<vtkIdTypeArray>&, vtkSmartPointer<vtkIdTypeArray>&, long long)'
/bin/ld: /usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:289: undefined reference to `pcl::visualization::PCLVisualizer::allocVtkPolyData(vtkSmartPointer<vtkPolyData>&)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `bool pcl::visualization::PCLVisualizer::updatePointCloud<pcl::PointXYZ>(pcl::PointCloud<pcl::PointXYZ>::ConstPtr const&, pcl::visualization::PointCloudColorHandler<pcl::PointXYZ> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:1583: undefined reference to `pcl::visualization::PCLVisualizer::updateCells(vtkSmartPointer<vtkIdTypeArray>&, vtkSmartPointer<vtkIdTypeArray>&, long long)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `bool pcl::visualization::PCLVisualizer::fromHandlersToScreen<pcl::PointXYZ>(pcl::visualization::PointCloudGeometryHandler<pcl::PointXYZ> const&, pcl::visualization::PointCloudColorHandler<pcl::PointXYZ> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&)':
/usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:1320: undefined reference to `pcl::visualization::PCLVisualizer::createActorFromVTKDataSet(vtkSmartPointer<vtkDataSet> const&, vtkSmartPointer<vtkLODActor>&, bool)'
/bin/ld: /usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:1325: undefined reference to `pcl::visualization::PCLVisualizer::addActorToRenderer(vtkSmartPointer<vtkProp> const&, int)'
/bin/ld: /usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:1334: undefined reference to `pcl::visualization::PCLVisualizer::convertToVtkMatrix(Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, vtkSmartPointer<vtkMatrix4x4>&)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `bool pcl::visualization::PCLVisualizer::addPointCloud<pcl::PointXYZ>(pcl::PointCloud<pcl::PointXYZ>::ConstPtr const&, pcl::visualization::PointCloudColorHandler<pcl::PointXYZ> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
/usr/include/pcl-1.10/pcl/visualization/impl/pcl_visualizer.hpp:146: undefined reference to `pcl::visualization::PointCloudGeometryHandlerXYZ<pcl::PointXYZ>::PointCloudGeometryHandlerXYZ(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZ> const> const&)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `main':
/data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:125: undefined reference to `pcl::visualization::PCLVisualizer::PCLVisualizer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:129: undefined reference to `pcl::visualization::PCLVisualizer::createViewPort(double, double, double, double, int&)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:130: undefined reference to `pcl::visualization::PCLVisualizer::createViewPort(double, double, double, double, int&)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `pcl::visualization::PCLVisualizer::registerKeyboardCallback(void (*)(pcl::visualization::KeyboardEvent const&, void*), void*)':
/usr/include/pcl-1.10/pcl/visualization/pcl_visualizer.h:177: undefined reference to `pcl::visualization::PCLVisualizer::registerKeyboardCallback(std::function<void (pcl::visualization::KeyboardEvent const&)>)'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o: in function `main':
/data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:171: undefined reference to `pcl::visualization::PCLVisualizer::wasStopped() const'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:173: undefined reference to `pcl::visualization::PCLVisualizer::spinOnce(int, bool)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:194: undefined reference to `pcl::visualization::PCLVisualizer::updateText(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int, double, double, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:125: undefined reference to `pcl::visualization::PCLVisualizer::~PCLVisualizer()'
/bin/ld: /data0/alexFiles/pointcloudtest/src/chapter10_tutorials/src/example.cpp:125: undefined reference to `pcl::visualization::PCLVisualizer::~PCLVisualizer()'
/bin/ld: CMakeFiles/example.dir/src/example.cpp.o:(.data.rel.ro._ZTVN3pcl13visualization28PointCloudGeometryHandlerXYZINS_8PointXYZEEE[_ZTVN3pcl13visualization28PointCloudGeometryHandlerXYZINS_8PointXYZEEE]+0x30): undefined reference to `pcl::visualization::PointCloudGeometryHandlerXYZ<pcl::PointXYZ>::getGeometry(vtkSmartPointer<vtkPoints>&) const'
collect2: error: ld returned 1 exit status
make[2]: *** [chapter10_tutorials/CMakeFiles/example.dir/build.make:366: chapter10_tutorials/example] Error 1
make[1]: *** [CMakeFiles/Makefile2:988: chapter10_tutorials/CMakeFiles/example.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Invoking "make -j40 -l40" failed
mvieth commented 1 year ago

Looks like this is an issue with PCL itself which can be fixed with sudo mkdir /lib/x86_64-linux-gnu/cmake/pcl/include sudo ln -s /usr/include/pcl-1.10/pcl /lib/x86_64-linux-gnu/cmake/pcl/include/pcl

That doesn't seem like a good solution. In fact, if you only make a link for the include files but not for the library files, that would explain why the includes can be found but the libraries can't be found. And by the way, would have been good if you mentioned earlier that you did this, that would have saved us some time. I see two possible solutions to your problem: either you make a link to the library files like you did with the include files (this is a bit hacky) or you undo the link to the include files and test these changes on your PCLConfig.cmake: https://github.com/PointCloudLibrary/pcl/pull/4664/commits/65a8d6bbd97e21f92af76b8fdf05ce3c000a4966

bigfacecat553 commented 1 year ago

And by the way, would have been good if you mentioned earlier that you did this, that would have saved us some time. I see two possible solutions to your problem: either you make a link to the library files like you did with the include files (this is a bit hacky) or you undo the link to the include files and test these changes on your PCLConfig.cmake: https://github.com/PointCloudLibrary/pcl/commit/65a8d6bbd97e21f92af76b8fdf05ce3c000a4966

I‘m sorry about that, so how can I fix it by making a new link, and sometimes the hacky way is the most effective.

mvieth commented 1 year ago

Similar to how you did the link for the includes, this could work (might be necessary to create one or two empty directories in the second path): sudo ln -s /usr/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu/cmake/pcl/lib/x86_64-linux-gnu

bigfacecat553 commented 1 year ago

Similar to how you did the link for the includes, this could work (might be necessary to create one or two empty directories in the second path): sudo ln -s /usr/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu/cmake/pcl/lib/x86_64-linux-gnu

Thanks, but I tried this, and it still reports the same error:

(base) alex@amax-Super-Server:/data0/alexFiles/pointcloudtest$ sudo mkdir /lib/x86_64-linux-gnu/cmake/pcl/lib/x86_64-linux-gnu
(base) alex@amax-Super-Server:/data0/alexFiles/pointcloudtest$ sudo ln -s /usr/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu/cmake/pcl/lib/x86_64-linux-gnu
(base) alex@amax-Super-Server:/data0/alexFiles/pointcloudtest$ catkin_make
bigfacecat553 commented 1 year ago
(base) alex@amax-Super-Server:/data0/alexFiles/pointcloudtest$ sudo mkdir /lib/x86_64-linux-gnu/cmake/pcl/lib/x86_64-linux-gnu
(base) alex@amax-Super-Server:/data0/alexFiles/pointcloudtest$ sudo ln -s /usr/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu/cmake/pcl/lib/x86_64-linux-gnu
(base) alex@amax-Super-Server:/data0/alexFiles/pointcloudtest$ catkin_make

I do some extra work according to your advice, and my code snippet begins from 417 to 430 (not 385 - 395) in PCLConfig.cmake:

find_package(PkgConfig QUIET)

file(TO_CMAKE_PATH "${PCL_DIR}" PCL_DIR)
get_filename_component(PCL_DIR "${PCL_DIR}" REALPATH)

if(WIN32 AND NOT MINGW)
# PCLConfig.cmake is installed to PCL_ROOT/cmake
  get_filename_component(PCL_ROOT "${PCL_DIR}" PATH)
else()
# PCLConfig.cmake is installed to PCL_ROOT/share/pcl-x.y
  get_filename_component(PCL_CONFIG_PATH "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
  get_filename_component(PCL_ROOT "${PCL_CONFIG_PATH}/../../../../" ABSOLUTE)
  #get_filename_component(PCL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../../.." ABSOLUTE)
endif()

and :

catkin_make
[ 90%] Built target pcl_filter
[ 95%] Linking CXX executable pcl_matching
[ 95%] Built target pcl_matching
[100%] Linking CXX executable example
[100%] Built target example
bigfacecat553 commented 1 year ago

Well, finally this problem is solved. I think the process is representative and it contains several other questions (https://github.com/PointCloudLibrary/pcl/issues/4472 , https://github.com/ouster-lidar/ouster_example/issues/314, https://github.com/kunaltyagi/pcl-cmake-minimum/blob/master/CMakeLists.txt, https://github.com/kunaltyagi/pcl-cmake-minimum/blob/master/CMakeLists.txt). I believe this page is meaningful and can prevent others from making similar mistakes.