PCL + ROS Indigo: include not found if I use catkin_package()

asked 2015-11-11 06:56:57 -0600

Tinrik gravatar image

updated 2015-11-11 07:51:14 -0600


I have installed ROS Indigo under Ubuntu 14.04. I am trying to create a ROS package that uses the PCL library. I am using QtCreator as IDE.

My main problem is that QtCreator can't find the PCL headers. For example:

#include <pcl/point_types.h>

Therefore it does not autocomplete anything related to PCL. However, it DOES compile if I have PCL code, so I don't know where the error is.

This is my CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.3)

find_package(catkin REQUIRED COMPONENTS

find_package(PCL REQUIRED)


include_directories(include ${PCL_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS} )


file(GLOB_RECURSE SOURCES src/*.cpp src/*.h)
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES})

And my package.xml:

<?xml version="1.0"?>
  <description>The data_visualizer package</description>

  <!-- One maintainer tag required, multiple allowed, one person per tag --> 
  <!-- Example:  -->
  <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
  <maintainer email="work@todo.todo">work</maintainer>

  <!-- One license tag required, multiple allowed, one license per tag -->
  <!-- Commonly used license strings: -->
  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->

  <!-- Url tags are optional, but mutiple are allowed, one per tag -->
  <!-- Optional attribute type can be: website, bugtracker, or repository -->
  <!-- Example: -->
  <!-- <url type="website">http://wiki.ros.org/data_visualizer</url> -->

  <!-- Author tags are optional, mutiple are allowed, one per tag -->
  <!-- Authors do not have to be maintianers, but could be -->
  <!-- Example: -->
  <!-- <author email="jane.doe@example.com">Jane Doe</author> -->

  <!-- The *_depend tags are used to specify dependencies -->
  <!-- Dependencies can be catkin packages or system dependencies -->
  <!-- Examples: -->
  <!-- Use build_depend for packages you need at compile time: -->
  <!--   <build_depend>message_generation</build_depend> -->
  <!-- Use buildtool_depend for build tool packages: -->
  <!--   <buildtool_depend>catkin</buildtool_depend> -->
  <!-- Use run_depend for packages you need at runtime: -->
  <!--   <run_depend>message_runtime</run_depend> -->
  <!-- Use test_depend for packages you need only for testing: -->
  <!--   <test_depend>gtest</test_depend> -->
  <!-- The export tag contains other, unspecified, tags -->
    <!-- Other tools can request additional information be placed here -->


Hint: I notice that if I comment out the line "catkin_package()" from the CMakeLists.txt, then QtCreator is able to locate the PCL headers. Does this sound familiar? Any ideas on how to fix this?

Thanks a lot!

edit retag flag offensive close merge delete


did you solve this? it also happens to me and it is quite annoying

Kailegh gravatar image Kailegh  ( 2017-02-17 03:53:31 -0600 )edit