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

The problem is that your package A exports the library aaa:

catkin_package(LIBRARIES aaa)

But when package B tries to find it it obviously does not exist.

Since catkin is unaware of the renaming (you could even install the library under a totally different name, e.g. libabc_d.so) it can't make any assumptions.

Therefore you need to change the exported library name to how it is actually called:

catkin_package(LIBRARIES aaa_d)

The problem is that your package A exports the library aaa:

catkin_package(LIBRARIES aaa)

But when package B tries to find it it obviously does not exist.

Since catkin is unaware of the renaming (you could even install the library under a totally different name, e.g. libabc_d.so) it can't make any assumptions.

Therefore you need to change the exported library name to how it is actually called:

catkin_package(LIBRARIES aaa_d)

Update:

If you extend your question to "how to export a debug and release library" the answer changes to:

You have to export both library names and in order to differentiate them use the CMake build configuration keywords (http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:target_link_libraries) before them:

catkin_package(LIBRARIES debug aaa_d optimized aaa)

Again, it wouldn't help if catkin would "be aware of the CMAKE_<conf>_POSTFIX variables". Simply because the name you give your library does not need to be the same after you installed it. And catkin must be able to resolve the installed library as well. That's why you must specify the name of the (potentially renamed installed) library explicitly.