我试图在MSYS2下构建cpprestsdk(https://github.com/Microsoft/cpprestsdk)。使用pacman
我安装了所需的依赖项:
但我得到以下输出:
$ 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程序员dude的好建议之后,我修复了设置cmake
中Boost_INCLUDE_DIR
的{{1}}错误。
但是当我发出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
我不打开另一个问题,因为我担心这个问题与之前的问题有关 - 并非完全修复。
答案 0 :(得分:0)
如果您要修改OpenSSL或Boost位置,则应修改文件:
cpprest_find_boost.cmake cpprest_find_openssl.cmake
您可以看到针对不同平台管理的不同方式。我已经修改了iOS以使用静态库而不是他们正在使用的框架解决方案。
两者都需要为每个相应的库提供正确的包含和正确的库路径。