【问题标题】:Problems finding Boost in cmake在 cmake 中找到 Boost 的问题
【发布时间】:2016-02-11 19:08:00
【问题描述】:

我正在尝试为 Windows 构建 Caffe,如下所述: https://github.com/willyd/caffe-windows-dependencies

为此,我需要下载我提取到 C:\Boost\boost_1_60_0 的 Boost(我有,版本 1.60.0) 在我设置的环境变量中:

BOOST_INCLUDEDIR : C:\Boost\boost_1_60_0\boost

BOOST_LIBRARYDIR : C:\Boost\boost_1_60_0\libs

BOOST_ROOT : C:\Boost\boost_1_60_0

我尝试使用以下命令运行 C​​Make gui:

来源:C:/libs/caffe/caffe-windows-dependencies

构建:C:\libs\caffe\build-caffe-windows-dependencies

但它失败并出现错误:

CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.3/Modules/FindBoost.cmake:1245 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.60.0

  Boost include path: C:/Boost/boost_1_60_0

  Could not find the following Boost libraries:

          boost_system
          boost_thread
          boost_filesystem
          boost_date_time

  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to     the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.
Call Stack (most recent call first):
  CMakeLists.txt:11 (find_package)


CMake Error at CMakeLists.txt:107 (set):
  Syntax error in cmake code at

    C:/libs/caffe/caffe-windows-dependencies/CMakeLists.txt:107

  when parsing string

    ${CMAKE_INSTALL_

  syntax error, unexpected $end, expecting } (16)

有人知道我哪里出错了吗?

【问题讨论】:

  • 请输出cmake -DBoost_DEBUG=ON <source-dir>
  • 除非你做了一些不寻常的事情,否则库目录不正确。您需要构建库,然后指定包含它们的目录。

标签: c++ boost cmake


【解决方案1】:

显然我只使用了头文件。 我通过用预构建的二进制文件替换 boost 文件夹解决了这个问题,一切都恢复正常了。

【讨论】:

  • 你能详细说明一下吗?我花了 8 个小时尝试使用 CMake 构建 socket.io,但它需要提升,我得到的错误与你得到的完全相同
猜你喜欢
  • 2017-06-23
  • 2011-04-18
  • 1970-01-01
  • 1970-01-01
  • 2011-12-26
  • 2012-10-28
  • 2022-01-02
相关资源
最近更新 更多