英文:
vcpkg on MinGW looks for Visual Studio
问题
根据 https://learn.microsoft.com/en-us/vcpkg/users/platforms/mingw 上的说明:
然而,vcpkg
需要 Visual Studio 才能正常工作。似乎与 vcpkg-cmake
包相关。
$ git clone https://github.com/microsoft/vcpkg.git vcpkg-mingw-64-ucrt64
克隆到 'vcpkg-mingw-64-ucrt64'...
远程: 正在计算对象: 194198,完成。
远程: 计数对象: 100% (41/41),完成。
远程: 压缩对象: 100% (21/21),完成。
远程: 总共 194198 (delta 21),复用 27 (delta 20),重用 194157
接收对象: 100% (194198/194198),69.75 MiB | 3.82 MiB/s, 完成。
解决差异: 100% (125287/125287),完成。
正在更新文件: 100% (10229/10229),完成。
$ cd vcpkg-mingw-64-ucrt64/
$ ./bootstrap-vcpkg.bat
正在下载 https://github.com/microsoft/vcpkg-tool/releases/download/2023-04-07/vcpkg.exe -> D:\Projects\vcpkg-mingw-64-ucrt64\vcpkg.exe... 完成。
验证签名... 完成。
遥测
---------
vcpkg 收集使用数据以帮助我们改善您的体验。
由 Microsoft 收集的数据是匿名的。
您可以通过重新运行 bootstrap-vcpkg 脚本并使用 -disableMetrics,通过在命令行中传递 --disable-metrics 给 vcpkg,或通过设置 VCPKG_DISABLE_METRICS 环境变量来选择退出遥测。
在 docs/about/privacy.md 上了解有关 vcpkg 遥测的更多信息
$ ./vcpkg install zlib:x64-mingw-dynamic
正在计算安装计划...
将构建和安装以下包:
* vcpkg-cmake[core]:x64-windows -> 2022-12-22
zlib[core]:x64-mingw-dynamic -> 1.2.13
将修改其他包 (*) 以完成此操作。
错误:在 x64-windows 三元组中找不到有效的 Visual Studio 实例
找不到完整的 Visual Studio 实例
英文:
Following instructions at https://learn.microsoft.com/en-us/vcpkg/users/platforms/mingw
However, vcpkg
requires Visual Studio to work. It seems that is related with vcpkg-cmake
package.
$ git clone https://github.com/microsoft/vcpkg.git vcpkg-mingw-64-ucrt64
Cloning into 'vcpkg-mingw-64-ucrt64'...
remote: Enumerating objects: 194198, done.
remote: Counting objects: 100% (41/41), done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 194198 (delta 21), reused 27 (delta 20), pack-reused 194157
Receiving objects: 100% (194198/194198), 69.75 MiB | 3.82 MiB/s, done.
Resolving deltas: 100% (125287/125287), done.
Updating files: 100% (10229/10229), done.
$ cd vcpkg-mingw-64-ucrt64/
$ ./bootstrap-vcpkg.bat
Downloading https://github.com/microsoft/vcpkg-tool/releases/download/2023-04-07/vcpkg.exe -> D:\Pro
jects\vcpkg-mingw-64-ucrt64\vcpkg.exe... done.
Validating signature... done.
Telemetry
---------
vcpkg collects usage data in order to help us improve your experience.
The data collected by Microsoft is anonymous.
You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics,
passing --disable-metrics to vcpkg on the command line,
or by setting the VCPKG_DISABLE_METRICS environment variable.
Read more about vcpkg telemetry at docs/about/privacy.md
$ ./vcpkg install zlib:x64-mingw-dynamic
Computing installation plan...
The following packages will be built and installed:
* vcpkg-cmake[core]:x64-windows -> 2022-12-22
zlib[core]:x64-mingw-dynamic -> 1.2.13
Additional packages (*) will be modified to complete this operation.
error: in triplet x64-windows: Unable to find a valid Visual Studio instance
Could not locate a complete Visual Studio instance
答案1
得分: 2
看到:
* vcpkg-cmake[core]:x64-windows -> 2022-12-22
zlib[core]:x64-mingw-dynamic -> 1.2.13
表明主机三元组未设置,使用了默认值。
尝试改用 ./vcpkg install zlib --triplet x64-mingw-dynamic --host-triplet x64-mingw-dynamic
或设置相应的环境变量 VCPKG_DEFAULT_TRIPLET
和 VCPKG_DEFAULT_HOST_TRIPLET
来更改默认值。
英文:
Looking at:
* vcpkg-cmake[core]:x64-windows -> 2022-12-22
zlib[core]:x64-mingw-dynamic -> 1.2.13
shows that the host triplet is not set and the default is used.
Try ./vcpkg install zlib --triplet x64-mingw-dynamic --host-triplet x64-mingw-dynamic
instead or set the according environment variables VCPKG_DEFAULT_TRIPLET
and VCPKG_DEFAULT_HOST_TRIPLET
to change the default.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论