VCPkg install过程中的错误解决
kelvin 发布于 2023-11-12

使用VCPkg可以下载安装相关的C/C++开源项目对应的静态库或者动态库,例如ffmpeg,librtmp,openssl等,也可以集成到Visual Studio的项目上,但用VCPkg install安装的时候出现了下面一些问题

,例如执行vcpkg install librtmp:64-windows,可能出现下面的问题

error: Failed to download from mirror set

error: https://github.com/madler/zlib/archive/v1.3.tar.gz: WinHttpSendRequest failed with exit code 12007

error: https://github.com/madler/zlib/archive/v1.3.tar.gz: WinHttpSendRequest failed with exit code 12002

error: https://github.com/madler/zlib/archive/v1.3.tar.gz: WinHttpSendRequest failed with exit code 12002

error: https://github.com/madler/zlib/archive/v1.3.tar.gz: WinHttpSendRequest failed with exit code 12002

 

error: building zlib:x64-windows failed with: BUILD_FAILED

Elapsed time to handle zlib:x64-windows: 4.1 min

Please ensure you're using the latest port files with `git pull` and `vcpkg update`.

 

从上面也可以看到除了安装想要的库,还可能下载安装其他的东西,例如zlib,openssl,cmake等,

然后执行下vcpkg list看了下安装的东西,增加了

openssl:x64-windows                               3.1.3               OpenSSL is an open source project that provides ...

vcpkg-cmake-config:x64-windows                    2022-02-06#1

vcpkg-cmake-get-vars:x64-windows                  2023-03-02

vcpkg-cmake:x64-windows                           2023-05-04

 

又再次执行vcpkg install librtmp:x64-windows

这次很快又出现一些错误,再列举安装的库发现还是没有librtmp,之后觉得是网络问题,如果在短时间内重新执行install估计还是会报错,然后间隔几个小时再执行可能就好了,这个有点像有时候访问github可以访问,有时候访问不了,应该是网络问题,或者一种办法是换个网络环境,后面多次尝试install之后就成功安装librtmp。

 

 

kelvin
关注 私信
文章
92
关注
0
粉丝
0