1、安装vcpkg
- git clone https://github.com/microsoft/vcpkg
- 运行 bootstrap-vcpkg.bat
2、用vcpkg安装cpprestsdk
- 下载cpprest,:git clone https://github.com/Microsoft/cpprestsdk.git
- 安装依赖库:vcpkg install --triplet x64-windows zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli
- 进入到cpprestsdk原代码目录 ./Release/libs 克隆websocketpp 原代码:git clone https://github.com/zaphoyd/websocketpp
- 返回到原代码根目录,新建目录
buildx64v143,进入buildx64v143目录,运行命令:
cmake ../Release -A x64 -DCMAKE_TOOLCHAIN_FILE=/REPLACE_THIS_WITH_PATH_TO/vcpkg/scripts/buildsystems/vcpkg.cmake
其中 /REPLACE_THIS_WITH_PATH_TO/vcpkg 代表的是vcpkg安装目录
- 一切正长的话,就会生成VS2022项目文件,可以通过VS进行编译了。