gpt4 book ai didi

boost - 如何将 BOOST_ROOT 和 BOOST_LIBRARY 传递给 CMake?

转载 作者:行者123 更新时间:2023-12-04 03:20:01 27 4
gpt4 key购买 nike

我想为 python 安装 dlib 模块我已经安装了 CMakeboost-python 但是当我安装 dlib 时它给了我错误:

We couldn't find the right version of boost python. If you installed boost and you are still getting this error then you might have installed a version of boost that was compiled with a different version of visual studio than the one you are using. So you have to make sure that the version of visual studio is the same version that was used to compile the copy of boost you are using. -- Set the BOOST_ROOT and BOOST_LIBRARYDIR environment variables before running cmake.

例如像这样:

set BOOST_ROOT=C:\local\boost_1_57_0

set BOOST_LIBRARYDIR=C:\local\boost_1_57_0\stage\lib

我不知道如何设置 BOOST_ROOTBOOST_LIBRARYDIR 路径。

最佳答案

要在运行 CMake 之前临时设置环境变量,您可以在控制台中键入这些命令:

set BOOST_ROOT=C:\local\boost_1_57_0
set BOOST_LIBRARYDIR=C:\local\boost_1_57_0\stage\lib
cmake ...

要永久设置它们,您可以使用 setx或通过 Windows GUI 单击。

我建议不要采用这些方法,更简洁可靠的方法是将这些变量直接传递给 CMake:

cmake -DBOOST_ROOT=C:\local\boost_1_57_0 -DBOOST_LIBRARYDIR=C:\local\boost_1_57_0\stage\lib

关于boost - 如何将 BOOST_ROOT 和 BOOST_LIBRARY 传递给 CMake?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38905480/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com