【问题标题】:How to access Beast on Boost 1.66 and 1.67 from CMake如何从 CMake 访问 Beast on Boost 1.66 和 1.67
【发布时间】:2018-11-30 06:43:39
【问题描述】:

我正在尝试使用 Beast 制作一个 CMake 项目,它已从 /usr/local/include/boost 中的源代码正确安装,但我无法让 CMake 找到它。我虽然可能是3.10.2,所以我厌倦了3.11.43.12.0-rc1,但都没有用。有谁知道该怎么做?

环境:Windows CLion 2018.1.5 和 WSL 上的 Ubuntu 18.04LTS。

尝试运行 CMake 时,我收到以下错误:

CMake Warning at /home/aidan/Apps/cmake-3.11.4-Linux-x86_64/share/cmake-3.11/Modules/FindBoost.cmake:1723 (message):
  No header defined for beast; skipping header check
Call Stack (most recent call first):
  CMakeLists.txt:15 (find_package)


CMake Error at /home/aidan/Apps/cmake-3.11.4-Linux-x86_64/share/cmake-3.11/Modules/FindBoost.cmake:2044 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.67.0

  Boost include path: /usr/local/include

  Could not find the following Boost libraries:

          boost_beast

  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.
Call Stack (most recent call first):
  CMakeLists.txt:15 (find_package)

【问题讨论】:

  • Boost Beast 是一个只有头文件的库。所以从find_package(Boost COMPONENTS ... REQUIRED) 调用中删除beast
  • @vre 哦,太酷了!您要回答吗,以便我将其标记为正确?
  • 很高兴它能帮助您解决问题。如果它完全回答了您的问题,请接受它。
  • @vre 是的,效果很好!

标签: ubuntu boost cmake boost-beast beast-websockets


【解决方案1】:

Boost beast 是一个只有头文件的库。 find_package(Boost COMPONENTS ...) 调用中不得引用仅标头库。所以从find_package(Boost COMPONENTS ... REQUIRED) 调用中删除beast

要了解 Boost 库是否只是标头,请查看以下Boost page

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-16
    • 1970-01-01
    相关资源
    最近更新 更多