title: How to remove the error: pcl/memory.h: No such file or directory while building c++ file?
body: <p>I am trying to make <a href="http://pointclouds.org/documentation/tutorials/pairwise_incremental_registration.php" rel="nofollow noreferrer">this tutorial</a> work for Various Point Cloud of Faces.</p>
  
  <p>I did found <a href="https://stackoverflow.com/questions/56633207/pcl-pcl-config-h-no-such-file-or-directory">this</a> and <a href="https://stackoverflow.com/questions/37725246/fatal-error-no-such-file-or-directory">this</a> answer, but can't seem to make them work for my case.</p>
  
  <p>I am trying to execute the "CMake" and "Make" command to build the C++ files.</p>
  
  <p>I have already run this <a href="http://pointclouds.org/documentation/tutorials/correspondence_grouping.php" rel="nofollow noreferrer">Correspondence Grouping tutorial</a> succesfully.<br/>
  Please help I am a beginner in Point Cloud Computations.<br/></p>
  
  <p>OS: Ubuntu 18.04</p>
  
  <p>Here is a snip of my error specifically:</p>
  
  <pre><code>Scanning dependencies of target pairwise_incremental_registration
  [ 50%] Building CXX object CMakeFiles/pairwise_incremental_registration.dir/pairwise_incremental_registration.cpp.o
  /home/sparsh/Desktop/incremental_pair_clouds/pairwise_incremental_registration.cpp:41:10: fatal error: pcl/memory.h: No such file or directory
   #include &lt;pcl/memory.h&gt;  // for pcl::make_shared
            ^~~~~~~~~~~~~~
  compilation terminated.
  CMakeFiles/pairwise_incremental_registration.dir/build.make:62: recipe for target 'CMakeFiles/pairwise_incremental_registration.dir/pairwise_incremental_registration.cpp.o' failed
  make[2]: *** [CMakeFiles/pairwise_incremental_registration.dir/pairwise_incremental_registration.cpp.o] Error 1
  CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pairwise_incremental_registration.dir/all' failed
  make[1]: *** [CMakeFiles/pairwise_incremental_registration.dir/all] Error 2
  Makefile:83: recipe for target 'all' failed
  make: *** [all] Error 2
  </code></pre>
  
  <p>My CMakeLists.txt is:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
  
  project(tuto-pairwise)
  
  find_package(PCL 1.4 REQUIRED)
  
  include_directories(${PCL_INCLUDE_DIRS})
  link_directories(${PCL_LIBRARY_DIRS})
  add_definitions(${PCL_DEFINITIONS})
  
  add_executable (pairwise_incremental_registration pairwise_incremental_registration.cpp)
  target_link_libraries (pairwise_incremental_registration ${PCL_LIBRARIES})
  </code></pre>
  
  <p>My Makefile generated is:-</p>
  
  <pre><code># CMAKE generated file: DO NOT EDIT!
  # Generated by "Unix Makefiles" Generator, CMake Version 3.10
  
  # Default target executed when no arguments are given to make.
  default_target: all
  
  .PHONY : default_target
  
  # Allow only one "make -f Makefile2" at a time, but pass parallelism.
  .NOTPARALLEL:
  
  
  #=============================================================================
  # Special targets provided by cmake.
  
  # Disable implicit rules so canonical targets will work.
  .SUFFIXES:
  
  
  # Remove some rules from gmake that .SUFFIXES does not remove.
  SUFFIXES =
  
  .SUFFIXES: .hpux_make_needs_suffix_list
  
  
  # Suppress display of executed commands.
  $(VERBOSE).SILENT:
  
  
  # A target that is always out of date.
  cmake_force:
  
  .PHONY : cmake_force
  
  #=============================================================================
  # Set environment variables for the build.
  
  # The shell in which to execute make rules.
  SHELL = /bin/sh
  
  # The CMake executable.
  CMAKE_COMMAND = /usr/bin/cmake
  
  # The command to remove a file.
  RM = /usr/bin/cmake -E remove -f
  
  # Escaping for special characters.
  EQUALS = =
  
  # The top-level source directory on which CMake was run.
  CMAKE_SOURCE_DIR = /home/sparsh/Desktop/incremental_pair_clouds
  
  # The top-level build directory on which CMake was run.
  CMAKE_BINARY_DIR = /home/sparsh/Desktop/incremental_pair_clouds/build
  
  #=============================================================================
  # Targets provided globally by CMake.
  
  # Special rule for the target rebuild_cache
  rebuild_cache:
      @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
      /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
  .PHONY : rebuild_cache
  
  # Special rule for the target rebuild_cache
  rebuild_cache/fast: rebuild_cache
  
  .PHONY : rebuild_cache/fast
  
  # Special rule for the target edit_cache
  edit_cache:
      @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
      /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
  .PHONY : edit_cache
  
  # Special rule for the target edit_cache
  edit_cache/fast: edit_cache
  
  .PHONY : edit_cache/fast
  
  # The main all target
  all: cmake_check_build_system
      $(CMAKE_COMMAND) -E cmake_progress_start /home/sparsh/Desktop/incremental_pair_clouds/build/CMakeFiles /home/sparsh/Desktop/incremental_pair_clouds/build/CMakeFiles/progress.marks
      $(MAKE) -f CMakeFiles/Makefile2 all
      $(CMAKE_COMMAND) -E cmake_progress_start /home/sparsh/Desktop/incremental_pair_clouds/build/CMakeFiles 0
  .PHONY : all
  
  # The main clean target
  clean:
      $(MAKE) -f CMakeFiles/Makefile2 clean
  .PHONY : clean
  
  # The main clean target
  clean/fast: clean
  
  .PHONY : clean/fast
  
  # Prepare targets for installation.
  preinstall: all
      $(MAKE) -f CMakeFiles/Makefile2 preinstall
  .PHONY : preinstall
  
  # Prepare targets for installation.
  preinstall/fast:
      $(MAKE) -f CMakeFiles/Makefile2 preinstall
  .PHONY : preinstall/fast
  
  # clear depends
  depend:
      $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
  .PHONY : depend
  
  #=============================================================================
  # Target rules for targets named pairwise_incremental_registration
  
  # Build rule for target.
  pairwise_incremental_registration: cmake_check_build_system
      $(MAKE) -f CMakeFiles/Makefile2 pairwise_incremental_registration
  .PHONY : pairwise_incremental_registration
  
  # fast build rule for target.
  pairwise_incremental_registration/fast:
      $(MAKE) -f CMakeFiles/pairwise_incremental_registration.dir/build.make CMakeFiles/pairwise_incremental_registration.dir/build
  .PHONY : pairwise_incremental_registration/fast
  
  pairwise_incremental_registration.o: pairwise_incremental_registration.cpp.o
  
  .PHONY : pairwise_incremental_registration.o
  
  # target to build an object file
  pairwise_incremental_registration.cpp.o:
      $(MAKE) -f CMakeFiles/pairwise_incremental_registration.dir/build.make CMakeFiles/pairwise_incremental_registration.dir/pairwise_incremental_registration.cpp.o
  .PHONY : pairwise_incremental_registration.cpp.o
  
  pairwise_incremental_registration.i: pairwise_incremental_registration.cpp.i
  
  .PHONY : pairwise_incremental_registration.i
  
  # target to preprocess a source file
  pairwise_incremental_registration.cpp.i:
      $(MAKE) -f CMakeFiles/pairwise_incremental_registration.dir/build.make CMakeFiles/pairwise_incremental_registration.dir/pairwise_incremental_registration.cpp.i
  .PHONY : pairwise_incremental_registration.cpp.i
  
  pairwise_incremental_registration.s: pairwise_incremental_registration.cpp.s
  
  .PHONY : pairwise_incremental_registration.s
  
  # target to generate assembly for a file
  pairwise_incremental_registration.cpp.s:
      $(MAKE) -f CMakeFiles/pairwise_incremental_registration.dir/build.make CMakeFiles/pairwise_incremental_registration.dir/pairwise_incremental_registration.cpp.s
  .PHONY : pairwise_incremental_registration.cpp.s
  
  # Help Target
  help:
      @echo "The following are some of the valid targets for this Makefile:"
      @echo "... all (the default if no target is provided)"
      @echo "... clean"
      @echo "... depend"
      @echo "... rebuild_cache"
      @echo "... pairwise_incremental_registration"
      @echo "... edit_cache"
      @echo "... pairwise_incremental_registration.o"
      @echo "... pairwise_incremental_registration.i"
      @echo "... pairwise_incremental_registration.s"
  .PHONY : help
  
  
  
  #=============================================================================
  # Special targets to cleanup operation of make.
  
  # Special rule to run CMake to check the build system integrity.
  # No rule that depends on this can have commands that come from listfiles
  # because they might be regenerated.
  cmake_check_build_system:
      $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
  .PHONY : cmake_check_build_system
  </code></pre>
  
  <p>After VERBOSE=1, the output of make</p>
  
  <pre><code>/usr/bin/cmake -H/home/sparsh/Desktop/incremental_pair_clouds -
  
  B/home/sparsh/Desktop/incremental_pair_clouds/build --check-build-system CMakeFiles/Makefile.cmake 0
      /usr/bin/cmake -E cmake_progress_start /home/sparsh/Desktop/incremental_pair_clouds/build/CMakeFiles /home/sparsh/Desktop/incremental_pair_clouds/build/CMakeFiles/progress.marks
      make -f CMakeFiles/Makefile2 all
      make[1]: Entering directory '/home/sparsh/Desktop/incremental_pair_clouds/build'
      make -f CMakeFiles/pairwise_incremental_registration.dir/build.make CMakeFiles/pairwise_incremental_registration.dir/depend
      make[2]: Entering directory '/home/sparsh/Desktop/incremental_pair_clouds/build'
      cd /home/sparsh/Desktop/incremental_pair_clouds/build &amp;&amp; /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/sparsh/Desktop/incremental_pair_clouds /home/sparsh/Desktop/incremental_pair_clouds /home/sparsh/Desktop/incremental_pair_clouds/build /home/sparsh/Desktop/incremental_pair_clouds/build /home/sparsh/Desktop/incremental_pair_clouds/build/CMakeFiles/pairwise_incremental_registration.dir/DependInfo.cmake --color=
      make[2]: Leaving directory '/home/sparsh/Desktop/incremental_pair_clouds/build'
      make -f CMakeFiles/pairwise_incremental_registration.dir/build.make CMakeFiles/pairwise_incremental_registration.dir/build
      make[2]: Entering directory '/home/sparsh/Desktop/incremental_pair_clouds/build'
      [ 50%] Building CXX object CMakeFiles/pairwise_incremental_registration.dir/pairwise_incremental_registration.cpp.o
      /usr/bin/c++  -DDISABLE_DAVIDSDK -DDISABLE_DSSDK -DDISABLE_ENSENSO -DDISABLE_LIBUSB_1_0 -DDISABLE_PCAP -DDISABLE_PNG -DDISABLE_RSSDK -DFLANN_STATIC -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -Dqh_QHpointer -DvtkFiltersFlowPaths_AUTOINIT="1(vtkFiltersParallelFlowPaths)" -DvtkIOExodus_AUTOINIT="1(vtkIOParallelExodus)" -DvtkIOGeometry_AUTOINIT="1(vtkIOMPIParallel)" -DvtkIOImage_AUTOINIT="1(vtkIOMPIImage)" -DvtkIOParallel_AUTOINIT="1(vtkIOMPIParallel)" -DvtkIOSQL_AUTOINIT="2(vtkIOMySQL,vtkIOPostgreSQL)" -DvtkRenderingContext2D_AUTOINIT="1(vtkRenderingContextOpenGL)" -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL)" -DvtkRenderingFreeType_AUTOINIT="2(vtkRenderingFreeTypeFontConfig,vtkRenderingMatplotlib)" -DvtkRenderingLIC_AUTOINIT="1(vtkRenderingParallelLIC)" -DvtkRenderingVolume_AUTOINIT="1(vtkRenderingVolumeOpenGL)" -I/usr/include/vtk-6.3 -I/usr/include/freetype2 -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu -I/usr/include/hdf5/openmpi -I/usr/include/libxml2 -I/usr/include/jsoncpp -I/usr/include/tcl -I/usr/include/pcl-1.8 -I/usr/include/eigen3 -I/usr/include/ni -I/usr/include/openni2 -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtWidgets -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++  -fPIC -std=gnu++11 -o CMakeFiles/pairwise_incremental_registration.dir/pairwise_incremental_registration.cpp.o -c /home/sparsh/Desktop/incremental_pair_clouds/pairwise_incremental_registration.cpp
      /home/sparsh/Desktop/incremental_pair_clouds/pairwise_incremental_registration.cpp:41:10: fatal error: pcl/memory.h: No such file or directory
       #include &lt;pcl/memory.h&gt;  // for pcl::make_shared
                ^~~~~~~~~~~~~~
      compilation terminated.
      CMakeFiles/pairwise_incremental_registration.dir/build.make:62: recipe for target 'CMakeFiles/pairwise_incremental_registration.dir/pairwise_incremental_registration.cpp.o' failed
      make[2]: *** [CMakeFiles/pairwise_incremental_registration.dir/pairwise_incremental_registration.cpp.o] Error 1
      make[2]: Leaving directory '/home/sparsh/Desktop/incremental_pair_clouds/build'
      CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/pairwise_incremental_registration.dir/all' failed
      make[1]: *** [CMakeFiles/pairwise_incremental_registration.dir/all] Error 2
      make[1]: Leaving directory '/home/sparsh/Desktop/incremental_pair_clouds/build'
      Makefile:83: recipe for target 'all' failed
      make: *** [all] Error 2
  </code></pre>
  
  <p>Stuff present in /usr/include/pcl-1.8/pcl</p>
  
  <pre><code>/usr/include/pcl-1.8/pcl$ ls
  
  2d                for_each_type.h      outofcore         point_cloud.h             ros
  apps              geometry             pcl_base.h        PointIndices.h            sample_consensus
  cloud_iterator.h  impl                 pcl_config.h      point_representation.h    search
  common            in_hand_scanner      pcl_exports.h     point_traits.h            segmentation
  compression       io                   PCLHeader.h       point_types_conversion.h  sse.h
  console           kdtree               PCLImage.h        point_types.h             stereo
  conversions.h     keypoints            pcl_macros.h      PolygonMesh.h             surface
  correspondence.h  ml                   PCLPointCloud2.h  range_image               TextureMesh.h
  exceptions.h      ModelCoefficients.h  PCLPointField.h   recognition               tracking
  features          modeler              pcl_tests.h       register_point_struct.h   Vertices.h
  filters           octree               people            registration              visualization
  </code></pre>