boost库找不到boost_thread Could not find the following Boost libraries: boost_thread

Ubuntu16.04  boost1.55,ros执行catkin_make时出现找不到boost_thread的错误,显示如下


  •   CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677 (message):
  •   Unable to find the requested Boost libraries.
  •   Boost version: 1.55.0
  •   Boost include path: /usr/local/include
  •   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.

    借鉴网址

    https://blog.csdn.net/landihao/article/details/78691981

    https://blog.csdn.net/songhc1986/article/details/46324567

     

    重新下载安装了boost1.65


  • sudo tar zxvf boost_1_65_1.tar.gz -C /opt/software

  • cd /opt/software/boost_1_65_1

  • sudo ./bootstrap.sh

  • sudo ./b2

  • sudo ./b2 install 


其中,./bootstrap.sh ,执行以后,显示编译了所有的库

Performing configuration checks

    - 32-bit                   : no
    - 64-bit                   : yes
    - arm                      : no
    - mips1                    : no
    - power                    : no
    - sparc                    : no
    - x86                      : yes

Building the Boost C++ Libraries.


    - symlinks supported       : yes
    - C++11 mutex              : no
    - lockfree boost::atomic_flag : yes
    - Boost.Config Feature Check: cxx11_auto_declarations : no
    - Boost.Config Feature Check: cxx11_constexpr : no
    - Boost.Config Feature Check: cxx11_defaulted_functions : no
    - Boost.Config Feature Check: cxx11_final : no
    - Boost.Config Feature Check: cxx11_hdr_mutex : no
    - Boost.Config Feature Check: cxx11_hdr_tuple : no
    - Boost.Config Feature Check: cxx11_lambdas : no
    - Boost.Config Feature Check: cxx11_noexcept : no
    - Boost.Config Feature Check: cxx11_nullptr : no
    - Boost.Config Feature Check: cxx11_rvalue_references : no
    - Boost.Config Feature Check: cxx11_template_aliases : no
    - Boost.Config Feature Check: cxx11_thread_local : no
    - Boost.Config Feature Check: cxx11_variadic_templates : no
    - has_icu builds           : yes
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam
    - zlib                     : yes
    - bzip2                    : yes
    - lzma                     : yes
    - iconv (libc)             : yes
    - icu                      : yes
    - native-atomic-int32-supported : yes
    - native-syslog-supported  : yes
    - pthread-supports-robust-mutexes : yes
    - compiler-supports-visibility : yes
    - compiler-supports-ssse3  : yes
    - compiler-supports-avx2   : yes
    - gcc visibility           : yes
    - long double support      : yes
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
    - libbacktrace builds      : yes
    - addr2line builds         : yes
    - WinDbg builds            : no
    - WinDbgCached builds      : no
    - zlib                     : yes
    - bzip2                    : yes
    - lzma                     : yes

Component configuration:

    - atomic                   : building
    - chrono                   : building
    - container                : building
    - context                  : building
    - coroutine                : building
    - date_time                : building
    - exception                : building
    - fiber                    : building
    - filesystem               : building
    - graph                    : building
    - graph_parallel           : building
    - iostreams                : building
    - locale                   : building
    - log                      : building
    - math                     : building
    - metaparse                : building
    - mpi                      : building
    - program_options          : building
    - python                   : building
    - random                   : building
    - regex                    : building
    - serialization            : building
    - signals                  : building
    - stacktrace               : building
    - system                   : building
    - test                     : building
    - thread                   : building
    - timer                    : building
    - type_erasure             : building
    - wave                     : building

 

您遇到的问题是在查找Boost库时出现了错误。根据错误信息,在您的系统中,无法找到所需的Boost库:boost_signals和boost_program_options。 首先,请确保您已经正确安装了Boost库的版本1.65.1,并且该版本的Boost库位于/usr/include目录下。 如果您确定已经安装了正确版本的Boost库,但仍然无法找到所需的库,可能是因为库文件没有正确的路径。您可以尝试使用以下方法解决这个问题: 1. 确保您已经将Boost库安装在正确的位置。您可以检查一下/usr/include目录下是否存在boost文件夹,并确认其内部是否包含所需的库文件。 2. 确保您的CMakeLists.txt文件中正确设置了Boost库的路径。您可以在CMakeLists.txt文件中使用find_package命令来查找Boost库,并将其路径设置为正确的位置。 例如,您可以在CMakeLists.txt文件中添加以下代码来查找Boost库: ``` find_package(Boost 1.65.1 COMPONENTS signals program_options REQUIRED) ``` 并确保在接下来的代码中使用了正确的Boost库路径。 3. 如果您在安装Boost库时使用了非默认的安装路径,您可以在CMakeLists.txt文件中使用BOOST_ROOT变量来指定Boost库的安装路径。例如: ``` set(BOOST_ROOT /path/to/boost) ``` 然后再使用find_package命令来查找Boost库。 通过以上步骤,您应该能够解决找不到Boost库的问题。希望对您有所帮助!如有其他问题,请随时提问。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值