Ask Your Question

Revision history [back]

Since you did not provide the full source code, I can only make educated guesses from the error message itself.

Boost::system is a CMake target that is imported with find_package(Boost COMPONENTS system). With modern CMake (>= 3.0), targets can carry all kinds of additional metadata, so if you link against them with target_link_libraries(), CMake will automatically add the required macro definitions, include paths, and other library dependencies. It's really nice and much simpler than the old way with global ${..._LIBRARIES} and ${..._INCLUDE_DIRS} variables.

The error message indicates that Boost::system was mistakenly treated the old way as a literal library name and prepended with -l. Either, you forgot to import the target with the find_package() call above, or another package you're depending did not properly export the Boost dependency. As catkin is relatively old, it has very limited support for modern CMake targets, so you may run into issues if a package tries to export them verbatim in catkin_package().