fatal error: pcl/visualization/pcl_visualizer.h: No such file or directory
Your Environment
- Operating System and version: Ubuntu 16.04
- Compiler:
- PCL Version: pcl 1.9
http://pointclouds.org/documentation/tutorials/pcl_visualizer.php#pcl-visualizer According to the link below, I create a pcl_visualizer.cpp and a CMakeLists.txt files, and I want to build it, I type the command: mkdir build cd build cmake ../ make but when I want to make it, it failed, it said: pcl_visualizer_demo.cpp:7:46: fatal error: pcl/visualization/pcl_visualizer.h: No such file or directory #include <pcl/visualization/pcl_visualizer.h> ^ compilation terminated. CMakeFiles/pcl_visualizer_demo.dir/build.make:62: recipe for target 'CMakeFiles/pcl_visualizer_demo.dir/pcl_visualizer_demo.cpp.o' failed make[2]: *** [CMakeFiles/pcl_visualizer_demo.dir/pcl_visualizer_demo.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pcl_visualizer_demo.dir/all' failed make[1]: *** [CMakeFiles/pcl_visualizer_demo.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2
I find that there exists the pcl_visualizer.h file, so what's the matter, why it cannot find the file pcl_visualizer.h? Thanks very much
What's the output of cmake .. step?
Thank you very much for your replying, the output of cmake .. is as follows:
-- The C compiler identification is GNU 4.9.4
-- The CXX compiler identification is GNU 4.9.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking for module 'eigen3'
-- Found eigen3, version 3.2.92
-- Found Eigen: /usr/include/eigen3
-- Eigen found (include: /usr/include/eigen3, version: 3.2.92)
CMake Warning at /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:765 (message):
Imported targets not available for Boost version 106800
Call Stack (most recent call first):
/usr/local/share/cmake-3.8/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES)
/usr/local/share/cmake-3.8/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES)
/usr/share/pcl-1.9/PCLConfig.cmake:134 (find_package)
/usr/share/pcl-1.9/PCLConfig.cmake:304 (find_boost)
/usr/share/pcl-1.9/PCLConfig.cmake:535 (find_external_library)
CMakeLists.txt:4 (find_package)
CMake Warning at /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:765 (message): Imported targets not available for Boost version 106800 Call Stack (most recent call first): /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES) /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES) /usr/share/pcl-1.9/PCLConfig.cmake:134 (find_package) /usr/share/pcl-1.9/PCLConfig.cmake:304 (find_boost) /usr/share/pcl-1.9/PCLConfig.cmake:535 (find_external_library) CMakeLists.txt:4 (find_package)
CMake Warning at /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:765 (message): Imported targets not available for Boost version 106800 Call Stack (most recent call first): /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES) /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES) /usr/share/pcl-1.9/PCLConfig.cmake:134 (find_package) /usr/share/pcl-1.9/PCLConfig.cmake:304 (find_boost) /usr/share/pcl-1.9/PCLConfig.cmake:535 (find_external_library) CMakeLists.txt:4 (find_package)
CMake Warning at /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:765 (message): Imported targets not available for Boost version 106800 Call Stack (most recent call first): /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES) /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES) /usr/share/pcl-1.9/PCLConfig.cmake:134 (find_package) /usr/share/pcl-1.9/PCLConfig.cmake:304 (find_boost) /usr/share/pcl-1.9/PCLConfig.cmake:535 (find_external_library) CMakeLists.txt:4 (find_package)
CMake Warning at /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:765 (message): Imported targets not available for Boost version 106800 Call Stack (most recent call first): /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES) /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES) /usr/share/pcl-1.9/PCLConfig.cmake:134 (find_package) /usr/share/pcl-1.9/PCLConfig.cmake:304 (find_boost) /usr/share/pcl-1.9/PCLConfig.cmake:535 (find_external_library) CMakeLists.txt:4 (find_package)
CMake Warning at /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:765 (message): Imported targets not available for Boost version 106800 Call Stack (most recent call first): /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES) /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES) /usr/share/pcl-1.9/PCLConfig.cmake:134 (find_package) /usr/share/pcl-1.9/PCLConfig.cmake:304 (find_boost) /usr/share/pcl-1.9/PCLConfig.cmake:535 (find_external_library) CMakeLists.txt:4 (find_package)
CMake Warning at /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:765 (message): Imported targets not available for Boost version 106800 Call Stack (most recent call first): /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES) /usr/local/share/cmake-3.8/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES) /usr/share/pcl-1.9/PCLConfig.cmake:134 (find_package) /usr/share/pcl-1.9/PCLConfig.cmake:304 (find_boost) /usr/share/pcl-1.9/PCLConfig.cmake:535 (find_external_library) CMakeLists.txt:4 (find_package)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Boost version: 1.68.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- thread
-- date_time
-- iostreams
-- serialization
-- chrono
-- Checking for module 'flann'
-- Found flann, version 1.8.4
-- FLANN found (include: , lib: flann_cpp)
-- Checking for module 'flann'
-- Found flann, version 1.8.4
-- FLANN found (include: , lib: flann_cpp)
-- Checking for module 'libusb-1.0'
-- Found libusb-1.0, version 1.0.20
-- Found USB_10: /usr/lib/x86_64-linux-gnu/libusb-1.0.so
-- Found OpenNI2: /usr/lib/libOpenNI2.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
-- Found libusb-1.0: /usr/include
** WARNING ** io features related to libusb-1.0 will be disabled
-- Found Qhull: optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so
-- 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
-- Found PCL_COMMON: /usr/lib/libpcl_common.so
-- looking for PCL_KDTREE
-- Found PCL_KDTREE: /usr/lib/libpcl_kdtree.so
-- looking for PCL_OCTREE
-- Found PCL_OCTREE: /usr/lib/libpcl_octree.so
-- looking for PCL_SEARCH
-- Found PCL_SEARCH: /usr/lib/libpcl_search.so
-- looking for PCL_SAMPLE_CONSENSUS
-- Found PCL_SAMPLE_CONSENSUS: /usr/lib/libpcl_sample_consensus.so
-- looking for PCL_FILTERS
-- Found PCL_FILTERS: /usr/lib/libpcl_filters.so
-- looking for PCL_2D
-- Found PCL_2D: /usr/include/pcl-1.9
-- looking for PCL_GEOMETRY
-- Found PCL_GEOMETRY: /usr/include/pcl-1.9
-- looking for PCL_IO
-- Found PCL_IO: /usr/lib/libpcl_io.so
-- looking for PCL_FEATURES
-- Found PCL_FEATURES: /usr/lib/libpcl_features.so
-- looking for PCL_ML
-- Found PCL_ML: /usr/lib/libpcl_ml.so
-- looking for PCL_SEGMENTATION
-- Found PCL_SEGMENTATION: /usr/lib/libpcl_segmentation.so
-- looking for PCL_SURFACE
-- Found PCL_SURFACE: /usr/lib/libpcl_surface.so
-- looking for PCL_REGISTRATION
-- Found PCL_REGISTRATION: /usr/lib/libpcl_registration.so
-- looking for PCL_KEYPOINTS
-- Found PCL_KEYPOINTS: /usr/lib/libpcl_keypoints.so
-- looking for PCL_TRACKING
-- Found PCL_TRACKING: /usr/lib/libpcl_tracking.so
-- looking for PCL_RECOGNITION
-- Found PCL_RECOGNITION: /usr/lib/libpcl_recognition.so
-- looking for PCL_STEREO
-- Found PCL_STEREO: /usr/lib/libpcl_stereo.so
-- looking for PCL_GPU_CONTAINERS
-- Found PCL_GPU_CONTAINERS: /usr/lib/libpcl_gpu_containers.so
-- looking for PCL_GPU_UTILS
-- Found PCL_GPU_UTILS: /usr/lib/libpcl_gpu_utils.so
-- looking for PCL_GPU_OCTREE
-- Found PCL_GPU_OCTREE: /usr/lib/libpcl_gpu_octree.so
-- looking for PCL_GPU_FEATURES
-- Found PCL_GPU_FEATURES: /usr/lib/libpcl_gpu_features.so
-- looking for PCL_GPU_SEGMENTATION
-- Found PCL_GPU_SEGMENTATION: /usr/lib/libpcl_gpu_segmentation.so
-- Found PCL: pcl_common;pcl_kdtree;pcl_octree;pcl_search;pcl_sample_consensus;pcl_filters;pcl_io;pcl_features;pcl_ml;pcl_segmentation;pcl_surface;pcl_registration;pcl_keypoints;pcl_tracking;pcl_recognition;pcl_stereo;pcl_gpu_containers;pcl_gpu_utils;pcl_gpu_octree;pcl_gpu_features;pcl_gpu_segmentation;/usr/local/boost_1_68_0/stage/lib/libboost_system.so;/usr/local/boost_1_68_0/stage/lib/libboost_filesystem.so;/usr/local/boost_1_68_0/stage/lib/libboost_thread.so;/usr/local/boost_1_68_0/stage/lib/libboost_date_time.so;/usr/local/boost_1_68_0/stage/lib/libboost_iostreams.so;/usr/local/boost_1_68_0/stage/lib/libboost_serialization.so;/usr/local/boost_1_68_0/stage/lib/libboost_chrono.so;optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so;/usr/lib/libOpenNI2.so;flann_cpp;vtkCommon;vtkFiltering;vtkImaging;vtkGraphics;vtkGenericFiltering;vtkIO;vtkRendering;vtkVolumeRendering;vtkHybrid;vtkWidgets;vtkParallel;vtkInfovis;vtkGeovis;vtkViews;vtkCharts (Required is at least version "1.9")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cindy/WorkSpace/PCDViewer/pcdViewer2/build
So your problems start at configuration time. You have a very strange environment. How did you obtain your Boost? It is not the one shipped with Ubuntu 16.04 You seem to have Boost 1.68 and according to this, it is not compatible with the CMake version you are using. Either upgrade Cmake or downgrade Boost.
@taketwo Thanks for your answering, as I have to install another application so I upgrade the Boost before. just now, I upgrade my cmake to cmake 3.13.0. and I build it again, in the cmake .. step , the output is as follows:
cindy@cindy:~/WorkSpace/PCDViewer/pcdViewer2/build$ cmake ..
-- The C compiler identification is GNU 4.9.4
-- The CXX compiler identification is GNU 4.9.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking for module 'eigen3'
-- Found eigen3, version 3.2.92
-- Found Eigen: /usr/include/eigen3
-- Eigen found (include: /usr/include/eigen3, version: 3.2.92)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Boost version: 1.68.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- thread
-- date_time
-- iostreams
-- serialization
-- chrono
-- atomic
-- regex
-- Checking for module 'flann'
-- Found flann, version 1.8.4
-- FLANN found (include: , lib: flann_cpp)
-- FLANN found (include: , lib: flann_cpp)
-- Checking for module 'libusb-1.0'
-- Found libusb-1.0, version 1.0.20
-- Found USB_10: /usr/lib/x86_64-linux-gnu/libusb-1.0.so
-- Found OpenNI2: /usr/lib/libOpenNI2.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
-- Found libusb-1.0: /usr/include
** WARNING ** io features related to libusb-1.0 will be disabled
-- Found Qhull: optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so
-- 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
-- Found PCL_COMMON: /usr/lib/libpcl_common.so
-- looking for PCL_KDTREE
-- Found PCL_KDTREE: /usr/lib/libpcl_kdtree.so
-- looking for PCL_OCTREE
-- Found PCL_OCTREE: /usr/lib/libpcl_octree.so
-- looking for PCL_SEARCH
-- Found PCL_SEARCH: /usr/lib/libpcl_search.so
-- looking for PCL_SAMPLE_CONSENSUS
-- Found PCL_SAMPLE_CONSENSUS: /usr/lib/libpcl_sample_consensus.so
-- looking for PCL_FILTERS
-- Found PCL_FILTERS: /usr/lib/libpcl_filters.so
-- looking for PCL_2D
-- Found PCL_2D: /usr/include/pcl-1.9
-- looking for PCL_GEOMETRY
-- Found PCL_GEOMETRY: /usr/include/pcl-1.9
-- looking for PCL_IO
-- Found PCL_IO: /usr/lib/libpcl_io.so
-- looking for PCL_FEATURES
-- Found PCL_FEATURES: /usr/lib/libpcl_features.so
-- looking for PCL_ML
-- Found PCL_ML: /usr/lib/libpcl_ml.so
-- looking for PCL_SEGMENTATION
-- Found PCL_SEGMENTATION: /usr/lib/libpcl_segmentation.so
-- looking for PCL_SURFACE
-- Found PCL_SURFACE: /usr/lib/libpcl_surface.so
-- looking for PCL_REGISTRATION
-- Found PCL_REGISTRATION: /usr/lib/libpcl_registration.so
-- looking for PCL_KEYPOINTS
-- Found PCL_KEYPOINTS: /usr/lib/libpcl_keypoints.so
-- looking for PCL_TRACKING
-- Found PCL_TRACKING: /usr/lib/libpcl_tracking.so
-- looking for PCL_RECOGNITION
-- Found PCL_RECOGNITION: /usr/lib/libpcl_recognition.so
-- looking for PCL_STEREO
-- Found PCL_STEREO: /usr/lib/libpcl_stereo.so
-- looking for PCL_GPU_CONTAINERS
-- Found PCL_GPU_CONTAINERS: /usr/lib/libpcl_gpu_containers.so
-- looking for PCL_GPU_UTILS
-- Found PCL_GPU_UTILS: /usr/lib/libpcl_gpu_utils.so
-- looking for PCL_GPU_OCTREE
-- Found PCL_GPU_OCTREE: /usr/lib/libpcl_gpu_octree.so
-- looking for PCL_GPU_FEATURES
-- Found PCL_GPU_FEATURES: /usr/lib/libpcl_gpu_features.so
-- looking for PCL_GPU_SEGMENTATION
-- Found PCL_GPU_SEGMENTATION: /usr/lib/libpcl_gpu_segmentation.so
-- Found PCL: pcl_common;pcl_kdtree;pcl_octree;pcl_search;pcl_sample_consensus;pcl_filters;pcl_io;pcl_features;pcl_ml;pcl_segmentation;pcl_surface;pcl_registration;pcl_keypoints;pcl_tracking;pcl_recognition;pcl_stereo;pcl_gpu_containers;pcl_gpu_utils;pcl_gpu_octree;pcl_gpu_features;pcl_gpu_segmentation;/usr/local/boost_1_68_0/stage/lib/libboost_system.so;/usr/local/boost_1_68_0/stage/lib/libboost_filesystem.so;/usr/local/boost_1_68_0/stage/lib/libboost_thread.so;-lpthread;/usr/local/boost_1_68_0/stage/lib/libboost_date_time.so;/usr/local/boost_1_68_0/stage/lib/libboost_iostreams.so;/usr/local/boost_1_68_0/stage/lib/libboost_serialization.so;/usr/local/boost_1_68_0/stage/lib/libboost_chrono.so;/usr/local/boost_1_68_0/stage/lib/libboost_atomic.so;/usr/local/boost_1_68_0/stage/lib/libboost_regex.so;optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so;/usr/lib/libOpenNI2.so;flann_cpp;vtkCommon;vtkFiltering;vtkImaging;vtkGraphics;vtkGenericFiltering;vtkIO;vtkRendering;vtkVolumeRendering;vtkHybrid;vtkWidgets;vtkParallel;vtkInfovis;vtkGeovis;vtkViews;vtkCharts (Required is at least version "1.9")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cindy/WorkSpace/PCDViewer/pcdViewer2/build
the in the make step, it still failed: cindy@cindy:~/WorkSpace/PCDViewer/pcdViewer2/build$ make Scanning dependencies of target pcl_visualizer_demo [ 50%] Building CXX object CMakeFiles/pcl_visualizer_demo.dir/pcl_visualizer_demo.cpp.o /home/cindy/WorkSpace/PCDViewer/pcdViewer2/pcl_visualizer_demo.cpp:7:46: fatal error: pcl/visualization/pcl_visualizer.h: No such file or directory #include <pcl/visualization/pcl_visualizer.h> ^ compilation terminated. CMakeFiles/pcl_visualizer_demo.dir/build.make:62: recipe for target 'CMakeFiles/pcl_visualizer_demo.dir/pcl_visualizer_demo.cpp.o' failed make[2]: *** [CMakeFiles/pcl_visualizer_demo.dir/pcl_visualizer_demo.cpp.o] Error 1 CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/pcl_visualizer_demo.dir/all' failed make[1]: *** [CMakeFiles/pcl_visualizer_demo.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2
what's the matter?
How did you obtain your PCL? It seems like it was built without visualization module, which is of course needed to build "PCL visualizer" tutorial.
@taketwo Thank you very much for your answering Yeah, I find that the visualization module was not build, I should first install vtk and then install pcl, before I just build pcl straight.so I installed vtk first and then build it again, now I can run the pcl_visualizer_demo.cpp. Thank you very much for your help sincerely~
You're welcome
I encountered the same problem! In this repository! I see that the instructions given by the author are: First install PCL, then VTK and then compiling the script. Same Error (Posted a question already. Ubuntu18.04.
/home/mk/PCN-PyTorch/sample/mesh_sampling.cpp:39:10: fatal error: pcl/visualization/pcl_visualizer.h: No such file or directory
#include <pcl/visualization/pcl_visualizer.h>
Should I do make clean or uninstall in any order, and then proceed to do it first with VTK and then PCL? I don't want to generate any broken dependencies, so I am being careful.