Ask Your Question
0

catkin_make fails, looking for -lBoost::system

asked 2021-01-22 13:24:13 -0500

TaCoDoS gravatar image

updated 2021-01-23 15:32:30 -0500

I am trying to run catkin make on a repo that I got from my schools github page for a project. I am the guinea pig trying out Ubuntu 20.04 with noetic, while everyone else is running a virtual machine of Ubuntu 18 with melodic. However after I init the catkin workspace and run catkin_make, I get the following errors (just showing the last few lines):

[ 68%] Built target hb_msgs_generate_messages_eus
[ 68%] Built target hb_msgs_generate_messages
[ 84%] Built target hb_viz
[ 88%] Linking CXX shared library /home/ellis77/School/ECEN483/hummingbird/devel/lib/libhb_ros_driver.so
/usr/bin/ld: cannot find -lBoost::system
collect2: error: ld returned 1 exit status
make[2]: *** [hb/hb_ros_driver/CMakeFiles/hb_ros_driver.dir/build.make:102: /home/ellis77/School/ECEN483/hummingbird/devel/lib/libhb_ros_driver.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:1537: hb/hb_ros_driver/CMakeFiles/hb_ros_driver.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
Invoking "make -j8 -l8" failed

And that is where it fails. I have installed -lBoost and it is up to date, but I am willing to try anything again. Maybe I don't understand the error message. Any help would be appreciated. I know that there could be issues between melodic and noetic, but this doesn't seem to be one of those. I could be wrong.

Edit: https://magiccvs.byu.edu/gitlab/hummi...

Here is the source code, except ignore the serial protocol directory. So just hb and hb student. Maybe the CMake files will help give clues, I have a hard time deciphering them.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-01-23 13:09:49 -0500

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().

edit flag offensive delete link more

Comments

https://magiccvs.byu.edu/gitlab/hummi...

Here is the source code, except ignore the serial protocol directory. So just hb and hb student. Maybe the CMake files will help give clues, I have a hard time deciphering them. @roehling

TaCoDoS gravatar image TaCoDoS  ( 2021-01-23 14:42:10 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2021-01-22 13:24:13 -0500

Seen: 261 times

Last updated: Jan 23 '21