boostcmakeroscatkin

Boost in catkin dependency after installing from source


I'm using Ubuntu 20.4, and I have installed Boost 1.81.0 from source, but when I try to build ROS Package using CMake, the dependency to Boost library is searched in the path /usr/lib/x86_64-linux-gnu/ with the default Boost Version 1.71.0 instead of the installed one 1.81.0 on /usr/local/lib/.

So when I build this package for example I'm getting the Error:

Errors     
<< abb_robot_cpp_utilities:
make /home/user/ros1_ws/pacbot_ws/logs/abb_robot_cpp_utilities/build.make.000.log                                                    
make[2]: *** No rule to make target 
  '/usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.71.0', 

needed by '/home/user/ros1_ws/pacbot_ws/devel/.private/abb_robot_cpp_utilities/lib/libabb_robot_cpp_utilities.so'.  
Stop.

I have the path /usr/local/lib/ exported export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib in my ~/.bashrc, and I have done sudo ldconfig already, but they didn't solve my problem, can you please tell me how can I solve this problem to compile the package correctly? thanks in advance.


Solution

  • Thanks to @Tsyvarev comments, The solution in my case was to:

    1. Remove all libboost* libraries, and boost folders.
    2. Install boost 1.71.0 from source in addition to the sudo apt install libboost-* libraries to solve the /usr/lib/x86_64-linux-gnu/ problem.