0
$\begingroup$

Rosanswers logo

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!


Originally posted by clyde on ROS Answers with karma: 1247 on 2017-11-14

Post score: 2


Original comments

Comment by Femer on 2017-11-15:
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).

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Femer with karma: 253 on 2017-11-15

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by clyde on 2017-11-15:
Ah, interesting. Thanks for the tip!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.