Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Boost Graph classes not recognized

I am trying to use Boost Graph on my node, but when I declare an object from Boost Graph I get these errors:

error: ‘adjacency_list’ does not name a type

error: ‘graph_traits’ does not name a type

Then I followed the instructions from this page to properly include the boost during compilation, but the error persists.

I'm sure that Boost Graph is installed and it's working, because I have compiled a similar code using Boost Graph which does not use ROS, so I think that the error stills in the CMakeLists.txt file. Other objects from Boost seem to work fine, like mpl::vector.

Here is my CMakeLists.txt:

cmake_minimum_required(VERSION 2.8.3)
project(prm_nav)

find_package(Boost REQUIRED COMPONENTS system thread graph)

find_package(catkin REQUIRED COMPONENTS
  geometry_msgs
  map_server
  nav_msgs
  roscpp
  tf
)

catkin_package(
INCLUDE_DIRS include
#  LIBRARIES prm_nav
#  CATKIN_DEPENDS geometry_msgs map_server nav_msgs roscpp tf
#  DEPENDS system_lib
)

include_directories(
  ${Boost_INCLUDE_DIRS}
  ${catkin_INCLUDE_DIRS}
)

add_executable(prm src/prm.cpp)    

target_link_libraries(prm
    ${Boost_LIBRARIES}
    ${catkin_LIBRARIES}   
)

So, what is the correct way to use Boost Graph inside ROS? Am I missing something in the CMakeLists.txt file?

Thanks a lot,