vcpkg 使用教程与可能遇到的问题

最近在使用vcpkg来更新开源项目的依赖库,中间遇到了不少问题,主要是不能像其它教程所描述的结果顺利更新,下面就将整个过程记录下来作为备忘。

1、首先从https://github.com/microsoft/vcpkg.git克隆源码,如果克隆速度慢,可以使用https://gitee.com/mirrors/vcpkg.git镜像地址,可以克隆在D:\vcpkg下,并检出自己需要的版本,本例使用2020-11版本

2、进入命令行控制台,进入D:\vcpkg, 执行bootstrap-vcpkg.bat,执行完毕后会编译生成vcpkg.exe;

3、如果正常情况下,调用 vcpkg.exe install  xxx 即可下载所需的依赖库并编译安装到D:\vcpkg\installed下;

4、如果更新中出现下载失败,一般是被墙了或者网络故障,可以使用代理来解决,通过分析,下载功能一般是调用了cmake的下载模块,cmake又调用了curl库;

5、curl库有2个代理环境变量(http_proxy,https_proxy),设置后即可下载成功;

6、如果还是下载失败,可尝试切换远程代理服务器来;

7、如果不是英文版,可以运行Visual Studio Installer选择>修改>语言包>英文>修改;

8、通过上面的操作如果还不能正常更新所需的依赖库,就需要看你的VS编译器是有源码编译所需的VS版本, 通过以上操作应该可以正常更新依赖包。如果还不行请百度,也可留言交流。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
https://github.com/microsoft/vcpkg/blob/master/docs/examples/installing-and-using-packages.md#step-2-use Step 1: Install First, we need to know what name SQLite goes by in the ports tree. To do that, we'll run the search command and inspect the output: PS D:\src\vcpkg> .\vcpkg search sqlite libodb-sqlite 2.4.0 Sqlite support for the ODB ORM library sqlite3 3.15.0 SQLite is a software library that implements a se... If your library is not listed, please open an issue at: https://github.com/Microsoft/vcpkg/issues Looking at the list, we can see that the port is named "sqlite3". You can also run the search command without arguments to see the full list of packages. Installing is then as simple as using the install command. PS D:\src\vcpkg> .\vcpkg install sqlite3 -- CURRENT_INSTALLED_DIR=D:/src/vcpkg/installed/x86-windows -- DOWNLOADS=D:/src/vcpkg/downloads -- CURRENT_PACKAGES_DIR=D:/src/vcpkg/packages/sqlite3_x86-windows -- CURRENT_BUILDTREES_DIR=D:/src/vcpkg/buildtrees/sqlite3 -- CURRENT_PORT_DIR=D:/src/vcpkg/ports/sqlite3/. -- Downloading https://sqlite.org/2016/sqlite-amalgamation-3150000.zip... -- Downloading https://sqlite.org/2016/sqlite-amalgamation-3150000.zip... OK -- Testing integrity of downloaded file... -- Testing integrity of downloaded file... OK -- Extracting source D:/src/vcpkg/downloads/sqlite-amalgamation-3150000.zip -- Extracting done -- Configuring x86-windows-rel -- Configuring x86-windows-rel done -- Configuring x86-windows-dbg -- Configuring x86-windows-dbg done -- Build x86-windows-rel -- Build x86-windows-rel done -- Build x86-windows-dbg -- Build x86-windows-dbg done -- Package x86-windows-rel -- Package x86-windows-rel done -- Package x86-windows-dbg -- Package x86-windows-dbg done -- Performing post-build validation -- Performing post-build validation done Package sqlite3:x86-windows is installed We can check that sqlite3 was successfully installed

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值