【问题标题】:CMake does not find boost_threadCMake 没有找到 boost_thread
【发布时间】:2016-10-13 19:40:19
【问题描述】:

我正在尝试安装 OpenGM 库。但是,在使用 CMake 时,我收到以下错误:

 CMake Error at /usr/local/share/cmake-3.6/Modules/FindBoost.cmake:1753 (message):
   Unable to find the requested Boost libraries.

   Boost version: 1.62.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.

但是,当我这样做时:

ls -l 

/usr/local/include

我得到以下行:

 lrwxr-xr-x   1 Florian  admin   36 13 oct 19:11 boost -> ../Cellar/boost/1.62.0/include/boost

这表明它在正确的目录中查找。

在:

/usr/local/lib

我有:

libboost_thread-mt.a            
libboost_thread-mt.dylib

所以,看来 boost_thread 库确实存在……

关于 Boost 相关的 CMake 配置,我有:

 Boost_DIR                        Boost_DIR-NOTFOUND                           
 Boost_INCLUDE_DIR                /usr/local/include                           
 Boost_LIBRARY_DIR_DEBUG          /usr/local/lib                               
 Boost_LIBRARY_DIR_RELEASE        /usr/local/lib                               
 Boost_PYTHON_LIBRARY_DEBUG       /usr/local/lib/libboost_python.dylib         
 Boost_PYTHON_LIBRARY_RELEASE     /usr/local/lib/libboost_python.dylib

如果有帮助,我在 Mac OSX 下,Boost 是通过以下方式安装的:

brew install boost --with-python
brew install boost-python

【问题讨论】:

  • 查看您的 CMake 文件会有所帮助

标签: macos boost cmake


【解决方案1】:

我已设法通过将 Boost 多线程标志设置为 ON n CMakeLists.txt 来处理此错误。

【讨论】:

    猜你喜欢
    • 2014-06-02
    • 2012-04-13
    • 2012-10-28
    • 1970-01-01
    • 2018-09-16
    • 1970-01-01
    • 2018-03-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多