Vcpkg (VC++ Packaging Tool)Windows系统下载安装开源库Visual Studio使用个人教程

Vcpkg Windows系统下载安装开源库个人教程


1.下载Vcpkg

可以将项目放置到想要的目录下


2.编译Vcpkg

使用Powershell在Vcpkg项目所在目录下,执行命令
bootstrap-vcpkg.bat
示例
Vcpkg项目内出现vcpkg.exe即成功
运行以下命令可查看支持下载的开源库
vcpkg search在这里插入图片描述


3.下载第三方库

vcpkg.exe install <pkg>:版本
以gmp库为例
vcpkg.exe install gmp:x64-windows
在这里插入图片描述

注意要下载64位版本的,如果不指定安装的架构,vcpkg 默认把开源库编译成 x86 的 Windows 版本的库,这可能会在日后使用中造成某些错误。

过程中遇到下载失败编译失败可多试两遍或参照下面资料:

若无法解决请另辟蹊径


4.将Vcpkg集成到全局

集成到全局适用于Visual Studio开发环境
vcpkg.exe integrate install
在这里插入图片描述


参考资料及可能用到的其他资料:

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、付费专栏及课程。

余额充值