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

CLion: This file does not belong to any project target

asked 2017-11-14 15:33:46 -0600

clyde gravatar image

When I use CLion on a ROS project, I get the following banner when looking at .h files: This file does not belong to any project target, code insight features might not work properly. Any insight?

To reproduce:

mkdir -p ~/catkin_ws/src
cd catkin_ws
catkin_make
source devel/setup.bash
cd src
git clone https://github.com/ros/geometry.git # Can be anything
cd ..
catkin_make
~/clion-2017.2.3/bin/clion.sh src/CMakeLists.txt

Then open any .h file to see the banner. Code completion works fine in .cpp files.

Thanks in advance!

edit retag flag offensive close merge delete

Comments

Hi Clyde. I have the same issue with Clion 2017.2.3 It does NOT happen (i.e. the .h file is seen correctly) in Clion 2017.1.3 It seems like that you're using 2017.2.3 as well (from the last line of your code snippet).

Femer gravatar image Femer  ( 2017-11-15 01:45:32 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-11-15 01:59:51 -0600

Femer gravatar image

One temporary workaround is:

  1. Right click in Clion on the specific include folder of the ROS package you are working with (for example if you're working with 'eigen_conversions', then right click on the folder include/eigen_conversions )
  2. Then click "Mark Directory as" -> "Library Files"

Now the files should be correctly seen by Clion and you can switch between definition and implementation.

edit flag offensive delete link more

Comments

Ah, interesting. Thanks for the tip!

clyde gravatar image clyde  ( 2017-11-15 10:55:08 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2017-11-14 15:33:46 -0600

Seen: 30,219 times

Last updated: Nov 15 '17