在catkin_make时发生如下错误:
CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677 (message):
Unable to find the requested Boost libraries.
Boost version: 1.54.0
Boost include path: /home/ilook/boost_1_54_0
Could not find the following Boost libraries:
boost_thread
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
首先找到boost_thread
库的位置:
ilook@ilook-vo:~/catkin_ws_robot$ locate boost_thread
/usr/lib/x86_64-linux-gnu/libboost_thread.a
/usr/lib/x86_64-linux-gnu/libboost_thread.so
/usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0
/usr/local/MATLAB/R2017a/bin/glnxa64/libboost_thread.so.1.56.0
发现boost_thread
库是存在的,网上博客有说使用软链接也可以解决,但是对于我不行,于是常识修改CmakeList中找寻boost库的路径。
在工程的CmakeList中修改:
set(BOOST_LIBRARYDIR /usr/lib)
find_package(Boost REQUIRED COMPONENTS thread)
将BOOST_LIBRARYDIR
修改成locate找到的lib路径,此时会优先在设置的路径寻找。
成功编译,其他库类似