【问题标题】:Cmake error at find packages to finish the build查找包以完成构建时出现 Cmake 错误
【发布时间】:2021-08-28 10:21:42
【问题描述】:

我想构建easyhttp - https://github.com/sony/easyhttpcpp/wiki/Installing-EasyHttp#build-easyhttp 在 Cmakeing 之后,它没有找到完成构建的包

CMake Error at /usr/local/lib/cmake/Poco/PocoConfig.cmake:29 (find_package):
  Could not find a package configuration file provided by "PocoNetSSL" with
  any of the following names:

    PocoNetSSLConfig.cmake
    poconetssl-config.cmake

  Add the installation prefix of "PocoNetSSL" to CMAKE_PREFIX_PATH or set
  "PocoNetSSL_DIR" to a directory containing one of the above files.  If
  "PocoNetSSL" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:56 (find_package)


-- Configuring incomplete, errors occurred!
See also "/mnt/d/Linux/easyhttpcpp/_build/CMakeFiles/CMakeOutput.log".

【问题讨论】:

  • 按照您链接的页面中的说明进行操作后是否正确安装了 poco?
  • 是的,它已正确安装
  • 安装在哪里?
  • 通常解决这个错误的方法是按照 CMake 告诉你的去做。
  • Debian / Ubuntu poco 软件包将匹配 easyhttp : apt install libpoco-dev ...... 例如,Ubuntu 20.04 → 没有 cmake 错误。 $ make : 没有错误。

标签: c++ linux cmake windows-subsystem-for-linux


【解决方案1】:

POCO Core 库不包含 PocoNetSSL 组件。所以需要额外安装。

使用 vcpkg 运行列出可用的不同 poco 组件:

./vcpgk search poco

你应该得到类似这样的输出:

poco                     1.11.0           Modern, powerful open source C++ class libraries for building network and ...
poco[mariadb]                             MariaDB support for POCO
poco[mysql]                               Mysql support for POCO
poco[netssl]                              NetSSL support for POCO
poco[pdf]                                 Haru support for POCO
poco[postgresql]                          PostgreSQL support for POCO
poco[sqlite3]                             Sqlite3 support for POCO

使用 vcpkg 运行 insatll poco[netssl]:

./vcpgk install poco[netssl] --recurse

使用 vcpkg 时不要忘记集成已安装的库以使其可用:

./vcpkg integrate install

查看https://vcpkg.readthedocs.io/en/latest/examples/installing-and-using-packages/ 了解有关如何将 vcpkg 与 cmake 一起使用的更多信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-25
    • 2017-09-16
    • 1970-01-01
    • 2017-12-22
    • 2019-02-03
    • 2017-04-08
    • 2018-09-06
    • 2014-09-01
    相关资源
    最近更新 更多