gpt4 book ai didi

c++ - cmake 在 Windows 上与 cpprestsdk 链接

转载 作者:行者123 更新时间:2023-11-28 04:14:44 33 4
gpt4 key购买 nike

我已经在 vs2017 中为 c++ 启动了新的 cmake 项目。并按照 cpprestsdk 说明在 Windows 上构建。

PM> vcpkg install cpprestsdk cpprestsdk:x64-windows

cmake_minimum_required (VERSION 3.8)
find_package(cpprestsdk REQUIRED)

错误

Severity Code Description Project File Line Suppression State Error CMake Error at CMakeProject1/CMakeLists.txt:5 (find_package):
By not providing "Findcpprestsdk.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "cpprestsdk", but CMake did not find one.

Could not find a package configuration file provided by "cpprestsdk" with any of the following names:

cpprestsdkConfig.cmake
cpprestsdk-config.cmake

Add the installation prefix of "cpprestsdk" to CMAKE_PREFIX_PATH or set "cpprestsdk_DIR" to a directory containing one of the above files. If "cpprestsdk" provides a separate development package or SDK, be sure it has been installed.

C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\berkin1\CMakeBuilds\c5a5aa79-502a-4e33-9202-078595e40dda\install\x64-Debug (default)" -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe" -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "c:\users\berkin1\source\repos\CMakeProject1" returned with exit code: 1 CMake Error at CMakeProject1/CMakeLists.txt:5 (find_package): By not providing "Findcpprestsdk.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by
"cpprestsdk", but CMake did not find one. Could not find a package configuration file provided by "cpprestsdk" with any of the following names: cpprestsdkConfig.cmake cpprestsdk-config.cmake Add the installation prefix of "cpprestsdk" to CMAKE_PREFIX_PATH or set "cpprestsdk_DIR" to a directory containing one of the above files. If "cpprestsdk" provides a separate development package or SDK, be sure it has been installed. c:\users\berkin1\source\repos\CMakeProject1\CMakeProject1/CMakeLists.txt 5

最佳答案

对我来说,将以下命令行选项添加到 cmake 是可行的:

-DVCPKG_TARGET_TRIPLET=x64-windows -DCMAKE_TOOLCHAIN_FILE=<vcpkg path>\scripts\buildsystems\vcpkg.cmake

关于c++ - cmake 在 Windows 上与 cpprestsdk 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56923989/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com