vcpkg安装
概述
vcpkg可以帮组你获取Windows平台的C和C++库。这个工具和ecosystem正处于预览阶段。您的参与对vcpkg的成功是非常的重要。 运行vcpkghelp可以获取可用命令的简短描述:
Commands:
vcpkg search [pat] Search for packages available to be built
vcpkg install <pkg>... Install a package
vcpkg remove <pkg>... Uninstall a package
vcpkg remove --outdated Uninstall all out-of-date packages
vcpkg list List installed packages
vcpkg update Display list of packages for updating
vcpkg upgrade Rebuild all outdated packages
vcpkg hash <file> [alg] Hash a file by specific algorithm, default SHA512
vcpkg help topics Display the list of help topics
vcpkg help <topic> Display help for a specific topic
vcpkg integrate install Make installed packages available user-wide. Requires admin privileges on first use
vcpkg integrate remove Remove user-wide integration
vcpkg integrate project Generate a referencing nuget package for individual VS project use
vcpkg integrate powershell Enable PowerShell Tab-Completion
vcpkg export <pkg>... [opt]... Exports a package
vcpkg edit <pkg> Open up a port for editing (uses %EDITOR%, default 'code')
vcpkg import <pkg> Import a pre-built library
vcpkg create <pkg> <url>
[archivename] Create a new package
vcpkg owns <pat> Search for files in installed packages
vcpkg env Creates a clean shell environment for development or compiling.
vcpkg version Display version information
vcpkg contact Display contact information to send feedback
Options:
--triplet <t> Specify the target architecture triplet.
(default: %VCPKG_DEFAULT_TRIPLET%, see 'vcpkg help triplet')
--vcpkg-root <path> Specify the vcpkg root directory
(default: %VCPKG_ROOT%)
For more help (including examples) see the accompanying README.md.
快速教程
-
安装要求:
- Visual Studio 2015 Update 3 or
- Visual Studio 2017
- CMake 3.8.0 或更高 (备注: 如果你机器上没有找到,将会自动安装到你的机器上)
- git.exe 加入到path中
-
克隆vcpkg库
git clone https://github.com/Microsoft/vcpkg.git
-
设定user-wide整合(初次执行需要管理员权限)
vcpkg.exe integrate install
-
安装库
vcpkg.exe install sqlite3 boost
-
最后,在Visual Studio 2015中新建工程,只需要
#include
对应的头文件即可使用。