Age.h file not found in exercise 2.5

Hi, I am struggling to #include my new Age.msg.

Age.msg is in topic_subscriber_pkg package under topic_subscriber_pkg/msg/Age.msg

I have tried
#include <topic_subscriber_pkg/Age.h>
#include <topic_subscriber_pkg/msg/Age.h>
#include <msg/Age.h>
It just can’t seem to find it. Do I need the msg file to be in a seperate pkg to the cpp I am trying to include it in?

best wishes,

Hi @j.nash,

Thanks for contacting us and welcome to the Community!

The right way to include the message would be:

#include <topic_subscriber_pkg/Age.h>

Please ensure that:

  • You have carefully followed the instructions to create your custom message.
  • You have run catkin_make.
  • You have run source ~/catkin_ws/devel/setup.bash on every terminal where you are trying to use the message. This is a common problem.

Please let us know.

Hi there,

Thank you for your response. Still having issues I am afraid. I have done the #include correctly. I have the source and have catkin_make also. If I use rosmsg info Age, I am getting the response showing the msg information. However the #include is still flagging that it cannot find the Age.h file! I have shown this below.


Thank you for the update.

Please ignore that flag and try to use your message and see. It might be a problem with the IDE. Sorry for the confusion.

We’ll look into why the IDE might be giving such false positives.