我正在尝试在 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_DIR
in的错误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
...
我没有提出另一个问题,因为我担心这个问题与前一个问题有关 - 没有完全解决。