【问题标题】:Can't find boost or python找不到 boost 或 python
【发布时间】:2015-05-12 13:37:51
【问题描述】:

我已经尝试了大多数建议,但仍然在某处失败。有人可以一步一步地指导我吗?我正在使用 cmake 3.2.2 和 vs2013。我也有 boost_1_57_0。

这是 camke 不断发送给我的错误消息

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

Unable to find the Boost header files.  Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Call Stack (most recent call first):
  C:/dlib-18.15/dlib/add_python_module:37 (FIND_PACKAGE)
  CMakeLists.txt:5 (include)


CMake Error at C:/Program Files/CMake/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
(Required is at least version "2.6")
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.2/Modules/FindPythonLibs.cmake:205 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  C:/dlib-18.15/dlib/add_python_module:38 (FIND_PACKAGE)
  CMakeLists.txt:5 (include)

有什么我可以输入到CMakeLists.txt file 的吗?如果是这样,我可以按照应该输入的确切方式输入它吗?

【问题讨论】:

    标签: python c++ boost cmake


    【解决方案1】:

    看看这些帖子,看看它们是否对您有帮助。很多这样的问题可以通过在顶层 CMakeLists.txt 中设置路径来解决。

    它应该看起来像这样:

    set(BOOST_ROOT "C:\boost")
    

    以下是对同一问题的其他一些参考:

    cmake doesn't find boost libraries

    How can I get cmake to find my alternative boost installation?

    【讨论】:

    • BOOST_ROOT 也可以通过命令行(例如 cmake -DBOOST_ROOT="C:\boost" )或 CMake GUI 设置。
    • 感谢您的建议,我会在成功运行后立即发布结果
    猜你喜欢
    • 2022-01-02
    • 2018-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-18
    • 1970-01-01
    相关资源
    最近更新 更多