如何从CMake访问Boost 1.66和1.67上的Beast

时间:2018-06-21 03:30:54

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

我正在尝试使用Beast创建CMake项目,并且已经从/usr/local/include/boost中的源代码中正确安装了该项目,但是我无法让CMake找到它。我虽然可能是3.10.2,但我很累3.11.43.12.0-rc1,但都没有用。有谁知道该怎么办?

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

尝试运行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)

1 个答案:

答案 0 :(得分:3)

flat_d = [v[1] for v in myD.items()] {"x":min([v["x"] for v in flat_d ]),"y":min([v["y"] for v in flat_d ])} 是仅标头的库。不得在Boost beast调用中引用仅标头的库。因此,请从find_package(Boost COMPONENTS ...)调用中删除beast

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