ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

cant find header files ROS open with QT Creator

asked 2019-10-26 12:12:25 -0600

snackbob gravatar image

updated 2022-05-23 09:03:58 -0600

lucasw gravatar image

I have ubuntu 18.04 + ROS melodic

I am following the ros tutorials for begginers

I have roscpp added to my include compoents in cmakelists

I am trying to open a cpp file in my project in the final src folder in my catkin workspace, as the tutorial does.

Tried opening cpp file. and it cannot find header files.

Error that come up in creator:

warning: this file is not part of any project
General messages: [ROS Warning] Unable to locate build directory for package: beginner_tutorials.
[ROS Warning] Failed to source workspace because this file does not exist: setup.bash.

in opening the cpp file in qt:

file, open new file->other project-> rosworkspace -> pjct name: catkin_ws buildsystem:CtakinTools choose workspace path=: /catkin_ws

i open workspace which is fine:

warning: [ROS Warning] Unable to locate package beginner_tutorials build file: /home/joe/catkin_ws/build/beginner_tutorials/beginner_tutorials.cbp.
[ROS Debug] Sourced workspace: /home/joe/catkin_ws/devel/setup.bash.
edit retag flag offensive close merge delete


Hej could you solve the problem? I m getting the same warning. Or can I ignore the warning?

I was following this tutorial : part 1 : and here part 2:

mateus224 gravatar image mateus224  ( 2020-08-26 09:14:53 -0600 )edit

I'm also having this problem. Have you found a solution yet? Thanks

azoic6 gravatar image azoic6  ( 2021-05-31 09:25:26 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2021-06-02 12:51:30 -0600

azoic6 gravatar image

I had the same problem (Ubuntu 18.04 + Qt Creator 4.9.2), and was able to solve it by restarting Qt Creator.

edit flag offensive delete link more

answered 2019-11-04 22:44:42 -0600

jschornak gravatar image

It sounds like you're using the ROS Qt Creator Plugin. Note that the plugin won't work correctly if you open an individual .cpp file outside a project.

  • Have you run catkin init in your catkin_ws directory?
  • Have you imported the ROS workspace into Qt Creator?
  • Have you built the project from within Qt Creator (ctrl-B, or the hammer icon in the lower left corner of the window).

You'll get lots of warnings if you haven't built the workspace from within Qt Creator. The plugin does some behind-the-scenes work when you build the package within Qt Creator in order to generate the code model, which enables syntax highlighting, autocompletion, and other quality-of-life features.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-10-26 12:12:25 -0600

Seen: 1,666 times

Last updated: May 23 '22