Windows下载安装vcpkg并使用它来安装第三方库(visualstudio)

1.使用Git下载vcpkg仓库(下载比较慢,个人比较喜欢打开下面网址然后用迅雷下载,速度飞快

git clone "https://github.com/Microsoft/vcpkg.git"

2.下载好之后解压打开文件夹,双击bootstrap-vcpkg.bat文件,如果成功的话会在文件夹里生成一个vcpkg.exe文件。(可能会出现窗口闪退导致没有生成exe文件,开启科学上网就可以解决

3.到这里vcpkg其实就安装完成了,使用vcpkg来安装库的流程如下:

  1. 在vcpkg所在的文件夹按住shift然后单击鼠标右键打开shell窗口
  2. 安装集成工具
    .\vcpkg.exe integrate install
  3. 生成配置文件
    .\vcpkg integrate project
    
  4. 下载所需要的第三方库(以gflags为例)在下载库之前它会先下载一个powershell的压缩包,但是这个压缩包下载的非常慢,所以建议复制对应的网址,使用迅雷下载(网址就是图片中https://github........这一大段)
    下载完成之后放到vcpkg文件夹下面的downloads文件夹里,然后再重新执行第4步的命令。
  5. 下载完成之后再重新生成配置文件:
    .\vcpkg.exe integrate project

    复制这段内容,然后打开visualstudio的项目终端,然后粘贴回车就OK了

 

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

余额充值