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

Revision history [back]

click to hide/show revision 1
initial version

You do not need:

  • I have package_B mentioned in the target_link_libraries for the package_A target.

and

add a line link_directories(${CATKIN_DEVEL_PREFIX}/lib})

If you add a lib created in a package in the same package's CMakeLists.txt catkin_package ( LIBRARIES ) section as you did here

  • I have package_B mentioned in catkin_package ( LIBRARIES ) section.

and find_package the package in a depending package as you did here

  • I have used find_package (package_B),

, the lib will automatically linked against targets in all depending packages.

Hint:

For this to work you need, as for all targets using ros functions, to link against catkin_LIBRARIES

target_link_libraries( your_target ${catkin_LIBRARIES} )