Catkin_make throws error in ROS basics in 5 days(C++) is throwing error

[ 21%] Building CXX object topic_subscriber_pkg/CMakeFiles/simple_topic_subscriber.dir/src/simple_topic_subscriber.cpp.o
/home/user/catkin_ws/src/topic_subscriber_pkg/src/simple_topic_subscriber.cpp:4:38: fatal error: topic_subscriber_pkg/Age.h: Nosuch file or directory
compilation terminated.
topic_subscriber_pkg/CMakeFiles/simple_topic_subscriber.dir/build.make:62: recipe for target ‘topic_subscriber_pkg/CMakeFiles/simple_topic_subscriber.dir/src/simple_topic_subscriber.cpp.o’ failed
make[2]: *** [topic_subscriber_pkg/CMakeFiles/simple_topic_subscriber.dir/src/simple_topic_subscriber.cpp.o] Error 1
CMakeFiles/Makefile2:2131: recipe for target ‘topic_subscriber_pkg/CMakeFiles/simple_topic_subscriber.dir/all’ failed
make[1]: *** [topic_subscriber_pkg/CMakeFiles/simple_topic_subscriber.dir/all] Error 2
Makefile:138: recipe for target ‘all’ failed
make: *** [all] Error 2
Invoking “make -j2 -l2” failed

hi @deepak.talwar,
welcome to the community :slight_smile:

it appears that the Age.h file does not exist in your package. I’m not very familiar with C++, however .h files are usually in the ‘include’ folder. Make sure the file exists and is at the right place.

1 Like

Also, it would be helpful if you share with us your CMakeLists.txt file. There are good chances that the error is there.

1 Like