Windows 上 vcpkg curl 中的一个可疑错误

艾哈姆·阿布·法德尔

简单地做: vcpkg.exe install curl:x86-windows

然后用 cmake 构建: cmake .. -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake

会输出:

C:\Users\altffour\Desktop\Projects\ContractNotifier\build>cmake .. -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.17763.
CMake Error at C:/vcpkg/installed/x86-windows/share/curl/vcpkg-cmake-wrapper.cmake:5 (_find_package):
  Could not find a configuration file for package "CURL" that is compatible
  with requested version "".

  The following configuration files were considered but not accepted:

    C:/vcpkg/installed/x86-windows/share/curl/CURLConfig.cmake, version: 7.66.0-DEV (32bit)

CMakeLists:

# curl
find_package(CURL CONFIG REQUIRED)
include_directories(${CURL_INCLUDE_DIR})

file(GLOB_RECURSE hdrs "src/*.h")
file(GLOB_RECURSE srcs "src/*.cpp")
file(GLOB_RECURSE ui "src/*.ui")
include_directories("." "src/")

add_executable(contractNotifier ${ui} ${hdrs} ${srcs})
target_link_libraries(contractNotifier Qt5::Core Qt5::Widgets Boost::serialization ${CMAKE_THREAD_LIBS_INIT} CURL::libcurl)

我发现了一个错误吗?

艾哈姆·阿布·法德尔

在这里解决https://github.com/microsoft/vcpkg/issues/9290

原因:使用传递给 vcpkg 的 :x64-windows 参数编译所有必需的包,并使用 -DVCPKG_TARGET_TRIPLET=x64-windows 调用 cmake 编译成功!

希望这可以帮助某人!

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章