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

Problem building in groovy with catkin and boost

asked 2013-04-11 09:03:12 -0600

MarkyMark2012 gravatar image

updated 2013-10-24 08:04:45 -0600

William gravatar image

Hi all,

Not sure what I've missed here - Just changed over from furte to groovy following http://www.ros.org/wiki/catkin/migrating_from_rosbuild. Everything was fine before. I've created a new catkin project area and just copied my code over. But for everything that uses ros i.e. #include "ros/ros.h" etc

[ 33%] Built target NetworkInterface
[ 66%] Built target RobotInterface
[100%] Building CXX object CMakeFiles/ToeminatorROSBridge.dir/src/ToeminatorROSBridge.cpp.o
In file included from /usr/include/boost/math/tools/config.hpp:13:0,
             from /usr/include/boost/math/special_functions/round.hpp:13,
             from /home/pi/ros_catkin_ws/install_isolated/include/ros/time.h:58,
             from /home/pi/ros_catkin_ws/install_isolated/include/ros/ros.h:38,
             from /home/pi/ros-apps/toeminator_ros_bridge2/src/ToeminatorROSBridge.cpp:1:
/usr/include/boost/config.hpp:35:33: fatal error: boost/config/compiler/gcc.hpp: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/ToeminatorROSBridge.dir/src/ToeminatorROSBridge.cpp.o] Error 1
make[1]: *** [CMakeFiles/ToeminatorROSBridge.dir/all] Error 2

Any help would be much appreciated.


EDIT: Adding CmakeLists.txt file

cmake_minimum_required(VERSION 2.8.3)
project(toeminator_ros_bridge2)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs tf)

## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED COMPONENTS system thread)

catkin_package(
INCLUDE_DIRS include
#  LIBRARIES toeminator_ros_bridge2
#  CATKIN_DEPENDS roscpp rospy std_msgs tf
#  DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(include
 ${catkin_INCLUDE_DIRS}
) 

include_directories(... ${Boost_INCLUDE_DIRS})

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
include_directories(include ${catkin_INCLUDE_DIRS})

add_library(RobotInterface src/RobotInterface.cpp)
add_library(NetworkInterface src/NetworkInterface.cpp)


add_executable(ToeminatorROSBridge src/ToeminatorROSBridge.cpp)
target_link_libraries(ToeminatorROSBridge RobotInterface)
target_link_libraries(ToeminatorROSBridge NetworkInterface)

Thanks

Mark

edit retag flag offensive close merge delete

Comments

Please update your question to add the relevant parts of your CMakeLists.txt, especially where you use the target_link_libraries() macro.

joq gravatar image joq  ( 2013-04-11 09:26:23 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2013-04-11 10:31:32 -0600

William gravatar image

updated 2013-04-13 13:37:20 -0600

Make sure that you are including the boost header path in your CMakeLists.txt:

...
find_package(Boost REQUIRED COMPONENTS system thread ...)
...
include_directories(... ${Boost_INCLUDE_DIRS})
...

EDIT:

The ellipsis ... are not meant to be used literally, I would modify your CMakeLists.txt to look like this:

cmake_minimum_required(VERSION 2.8.3)
project(toeminator_ros_bridge2)

find_package(Boost REQUIRED COMPONENTS system thread)

find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs tf)

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES RobotInterface NetworkInterface
  CATKIN_DEPENDS roscpp rospy std_msgs tf
  DEPENDS Boost
)

include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})

add_library(RobotInterface src/RobotInterface.cpp)
target_link_libraries(RobotInterface ${catkin_LIBRARIES} ${Boost_LIBRARIES})
add_library(NetworkInterface src/NetworkInterface.cpp)
target_link_libraries(NetworkInterface ${catkin_LIBRARIES} ${Boost_LIBRARIES})

add_executable(ToeminatorROSBridge src/ToeminatorROSBridge.cpp)
target_link_libraries(ToeminatorROSBridge
  RobotInterface
  NetworkInterface
  ${catkin_LIBRARIES}
  ${Boost_LIBRARIES}
)

This might be linking somethings unnecessarily, but it should work. Without looking at how each of your libraries and executables are using ROS stuff and Boost I cannot know how to write your build file exactly right.

edit flag offensive delete link more

Comments

Thanks for the info - Added those to the makefile - still no change :(

MarkyMark2012 gravatar image MarkyMark2012  ( 2013-04-12 22:39:41 -0600 )edit
2

You added them to the CMakeLists.txt or the Makefile? They should go in the CMakeLists.txt

William gravatar image William  ( 2013-04-13 13:26:29 -0600 )edit

Question Tools

Stats

Asked: 2013-04-11 09:03:12 -0600

Seen: 2,709 times

Last updated: Oct 24 '13