我下载了cpp-netlib源代码,将其解压缩到一个文件夹中,由于某种原因,我完全迷路了。我仔细阅读了文档,它说明我也必须下载CMake,我也下载了。然后设置源目录并构建目录,然后单击"Generate“按钮,得到如下输出:
The CXX compiler identification is MSVC 19.0.23506.0
Check for working C compiler using: Visual Studio 14 2015
Check for working C compiler using: Visual Studio 14 2015 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 14 2015
Check for working CXX compiler using: Visual Studio 14 2015 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.5/Modules/FindBoost.cmake:1657 (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):
CMakeLists.txt:49 (find_package)
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
CMake Error at CMakeLists.txt:131 (export):
export given target "cppnetlib-client-connections" which is not built by
this project.
Configuring incomplete, errors occurred!
See also "C:/Users/Nick/Documents/cpp-netlib/cpp-netlib-build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Nick/Documents/cpp-netlib/cpp-netlib-build/CMakeFiles/CMakeError.log"它找不到Boost库,这就是我被困的地方。我安装了boost,但是我不知道在哪里设置"BOOST_ROOT“。我对此做了一些研究,尝试使用命令行和-DBOOST_ROOT选项,如下所示:
c:\Program Files>cmake -DBOOST_ROOT=/boost/boost_1_55_0但它给了我以下错误:
CMake Error: The source directory "C:/Program Files" does not appear to contain
CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.我真的不知道现在该怎么办,我觉得我的问题还没有结束.我有什么明显的遗漏吗?
发布于 2016-05-01 20:35:04
您需要从源树(它将包含CMakeLists.txt)运行cmake,或者更典型地,从构建文件夹运行cmake并告诉它源树在哪里。常见的情况是在源树旁边创建一个构建文件夹并运行cmake ../sourcedir。
您似乎最初使用了gui;当然,这提供了一种设置BOOST_ROOT变量的方法?
或者,如果您只是在VC++包含/LIB路径中添加了boost (或者在vc目录中,或者通过设置%INCLUDE%/%LIB%),那么您可能不需要BOOST_ROOT。OpenSSL也一样。
https://stackoverflow.com/questions/36971445
复制相似问题