【问题标题】:CMake Boost 1.59.0 geometryCMake Boost 1.59.0 几何
【发布时间】:2015-11-21 12:33:08
【问题描述】:

我对将 boost 与 C++ 一起使用是相当陌生的。我刚刚安装了 Boost 1.59.0,我想使用几何库。

如果我包含FIND_PACKAGE( Boost 1.47 REQUIRED ),它会发现提升并且不会出现任何问题。如果我随后包含FIND_PACKAGE( Boost 1.47 COMPONENTS geometry REQUIRED ),则会收到以下错误:

 Unable to find the requested Boost libraries.

  Boost version: 1.59.0

  Boost include path: /usr/include

  Could not find the following Boost libraries:

          boost_geometry

  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.

如果我在 CLI 中运行以下 [ -f /usr/include/boost/geometry/geometry.hpp ] && echo "Found" || echo "Not found",我会得到 Found。所以它似乎在那里,但 CMake 告诉我它不是。

我误会了什么?

【问题讨论】:

标签: c++ boost boost-geometry


【解决方案1】:

COMPONENTS 仅对已构建的库是必需的。 Geometry 是一个只有头文件的库,所以不需要它。您只需要找到 boost headers 的位置。

【讨论】:

    猜你喜欢
    • 2012-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-18
    • 1970-01-01
    • 2018-09-25
    相关资源
    最近更新 更多