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

Problem with Header File Not Being Sensed in Compilation [closed]

asked 2014-07-30 17:42:30 -0500

jc2016 gravatar image

Hello,

I am having issues compiling a simple package that I built. In the end, after compilation I am getting an error:

make[2]: *** [robbie_tf/CMakeFiles/robbie_tf_node.dir/src/robbie_tf_node.cpp.o] Error 1
make[1]: *** [robbie_tf/CMakeFiles/robbie_tf_node.dir/all] Error 2

But, earlier in the compilation, I am getting an error:

/home/jmcunnin/catkin_ws/src/robbie_tf/src/robbie_tf_node.cpp:28:38: fatal error: robbie_tf/robbie_tf_node.h: No such file or directory compilation terminated.

The package that I am compiling is named robbie_tf and the header file that is not being used is the header for the node file (kind of an issue :P). Any help would be appreciated.

Also, this is my CMake file:

cmake_minimum_required(VERSION 2.8.3)

project(robbie_tf)


find_package(catkin REQUIRED COMPONENTS
people_msgs
roscpp
rospy
std_msgs
tf
)

find_package(Boost REQUIRED COMPONENTS thread)

catkin_package(
 INCLUDE_DIRS include
 LIBRARIES robbie_tf
)


include_directories(
   ${catkin_INCLUDE_DIRS}
)

add_library(robbie_tf_node
   src/robbie_tf_node.cpp
 )


 add_executable(robbie_tf src/robbie_tf_node.cpp)


add_dependencies(robbie_tf_node robbie_tf_generate_messages_cpp)


target_link_libraries(robbie_tf
  robbie_tf_node ${catkin_LIBRARIES} ${Boost_LIBRARIES}
 )

I would assume that the issue lies in the CMakeList but I'm not sure where my declarations are going wrong.

Thanks, for the help

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by jc2016
close date 2014-08-04 09:32:20.606246

1 Answer

Sort by ยป oldest newest most voted
3

answered 2014-07-30 18:15:11 -0500

Dirk Thomas gravatar image

updated 2014-07-30 18:15:33 -0500

You need to add the include folder of your package to the include_directories() call:

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
)

Your CMake file also lacks some install rules to install your headers and artifacts (but that is a different topic).

edit flag offensive delete link more

Comments

This ended up working out. Thanks for the pointer.

jc2016 gravatar image jc2016  ( 2014-07-31 13:00:02 -0500 )edit

Also, do you happen to know if there are any resources where I can read up on headers and artifacts?

jc2016 gravatar image jc2016  ( 2014-07-31 14:50:43 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-07-30 17:42:30 -0500

Seen: 170 times

Last updated: Jul 30 '14