1

我正在尝试在 MSYS2 下构建 cpprestsdk ( https://github.com/Microsoft/cpprestsdk )。随着pacman我安装了所需的依赖项:

  • 促进
  • openssl

但我得到以下输出:

$ cmake -G "MSYS Makefiles" .. -DCMAKE_BUILD_TYPE=Release
-- Setting gcc options
-- Added test library httpclient_test
-- Added test library httplistener_test
-- Added test library json_test
-- Added test library pplx_test
-- Added test library streams_test
-- Added test library uri_test
-- Added test library utils_test
-- Added test library websocketclient_test CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the
CMake files:
C:/cpprestsdk/Release/src/Boost_INCLUDE_DIR
used as include directory in directory
C:/cpprestsdk/Release/src
C:/cpprestsdk/Release/tests/functional/streams/Boost_INCLUDE_DIR
used as include directory in directory
C:/cpprestsdk/Release/tests/functional/streams
C:/cpprestsdk/Release/tests/functional/websockets/Boost_INCLUDE_DIR
used as include directory in directory
C:/cpprestsdk/Release/tests/functional/websockets

-- Configuring incomplete, errors occurred! See also "C:/cpprestsdk/Release/build.release/CMakeFiles/CMakeOutput.log".

我很难理解这些错误的真正含义。我试图检查日志输出,但没有发现任何明显的东西......

我是否缺少其他一些依赖项?

更新

在@Some程序员老兄的好建议之后,我修复了cmake设置Boost_INCLUDE_DIRin的错误CMakelist.txt

make但是现在当我发出命令时我有了这个:

$ make
Scanning dependencies of target cpprest
[  0%] Building CXX object src/CMakeFiles/cpprest.dir/http/client/http_client.cpp.obj
cc1plus.exe: error: /mingw32/include/boost: No such file or directory [-Werror=missing-include-dirs]

它说它找不到/mingw32/include/boost,但它确实存在:

$ ls /mingw32/include/boost/
accumulators             context                       fusion                  make_unique.hpp                predef                         spirit
algorithm                convert                       generator_iterator.hpp  math                           predef.h                       spirit.hpp
align                    convert.hpp                   geometry                math_fwd.hpp                   preprocessor                   statechart
align.hpp                core                          geometry.hpp            mem_fn.hpp                     preprocessor.hpp               static_assert.hpp
aligned_storage.hpp      coroutine                     get_pointer.hpp         memory_order.hpp               program_options                swap.hpp
any.hpp                  coroutine2                    gil                     metaparse                      program_options.hpp            system
...

我没有提出另一个问题,因为我担心这个问题与前一个问题有关 - 没有完全解决。

4

1 回答 1

0

如果您要修改 OpenSSL 或 Boost 位置,则应修改文件:

cpprest_find_boost.cmake cpprest_find_openssl.cmake

您可以看到针对不同平台管理它的不同方式。我已经针对 iOS 进行了修改,以使用静态库而不是他们使用的框架解决方案。

两者都需要为每个相应的库提供正确的包含和正确的库路径。

于 2017-05-28T18:01:36.873 回答