vcpkg的安装

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/flyfish1986/article/details/83186253

vcpkg的安装

flyfsih

执行git下载时出现

unable to access 'https://github.com/Microsoft/vcpkg.git/': Failed to connect to 127.0.0.1 port 1080: Connection refused

编辑
~/.gitconfig

删除内容解决

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

启动PowerShell要有管理员权限
PS> .\bootstrap-vcpkg.bat

之后开始编译
Building vcpkg.exe

PS> .\vcpkg integrate install

执行WindowsPowerShell问题

. : 无法加载文件 \WindowsPowerShell\Microsoft.PowerShell_profile.ps1,因为在此系统上禁止运行
脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 3

    + . '\WindowsPowerShell\Microsoft.PowerShell_pro ...
    +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : SecurityError: (:) [],PSSecurityException
        + FullyQualifiedErrorId : UnauthorizedAccess
        + 

执行如下命令解决
PS C:\WINDOWS\system32> set-executionpolicy remotesigned

使用vcpkg安装C++库时可选
arm-uwp
x64-uwp
x64-windows-static
x64-windows
x86-uwp
x86-windows-static
x86-windows

vcpkg默认安装32位的库,为了让它安装64位的库,添加系统环境变量:
VCPKG_DEFAULT_TRIPLET=x64-windows

猜你喜欢

转载自blog.csdn.net/flyfish1986/article/details/83186253