C++ Library Manager for Windows, Linux, and MacOS

Vcpkg: Overview

中文总览 Español 한국어 Français

Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS. This tool and ecosystem are constantly evolving, and we always appreciate contributions!

If you've never used vcpkg before, or if you're trying to figure out how to use vcpkg, check out our Getting Started section for how to start using vcpkg.

For short description of available commands, once you've installed vcpkg, you can run vcpkg help, or vcpkg help [command] for command-specific help.

Table of Contents

Getting Started

First, follow the quick start guide for either Windows, or macOS and Linux, depending on what you're using.

For more information, see Installing and Using Packages. If a library you need is not present in the vcpkg catalog, you can open an issue on the GitHub repo where the vcpkg team and community can see it, and potentially add the port to vcpkg.

After you've gotten vcpkg installed and working, you may wish to add tab completion to your shell.

Finally, if you're interested in the future of vcpkg, check out the manifest guide! This is an experimental feature and will likely have bugs, so try it out and open all the issues!

Quick Start: Windows

Prerequisites:

  • Windows 7 or newer
  • Git
  • Visual Studio 2015 Update 3 or greater with the English language pack

First, download and bootstrap vcpkg itself; it can be installed anywhere, but generally we recommend using vcpkg as a submodule for CMake projects, and installing it globally for Visual Studio projects. We recommend somewhere like C:\src\vcpkg or C:\dev\vcpkg, since otherwise you may run into path issues for some port build systems.

> git clone https://github.com/microsoft/vcpkg
> .\vcpkg\bootstrap-vcpkg.bat

To install the libraries for your project, run:

> .\vcpkg\vcpkg install [packages to install]

Note: This will install x86 libraries by default. To install x64, run:

> .\vcpkg\vcpkg install [package name]:x64-windows

Or

> .\vcpkg\vcpkg install [packages to install] --triplet=x64-windows

You can also search for the libraries you need with the search subcommand:

> .\vcpkg\vcpkg search [search term]

In order to use vcpkg with Visual Studio, run the following command (may require administrator elevation):

> .\vcpkg\vcpkg integrate install

After this, you can now create a New non-CMake Project (or open an existing one). All installed libraries are immediately ready to be #include'd and used in your project without additional configuration.

If you're using CMake with Visual Studio, continue here.

In order to use vcpkg with CMake outside of an IDE, you can use the toolchain file:

> cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake
> cmake --build [build directory]

With CMake, you will still need to find_package and the like to use the libraries. Check out the CMake section for more information, including on using CMake with an IDE.

For any other tools, including Visual Studio Code, check out the integration guide.

Quick Start: Unix

Prerequisites for Linux:

Prerequisites for macOS:

First, download and bootstrap vcpkg itself; it can be installed anywhere, but generally we recommend using vcpkg as a submodule for CMake projects.

$ git clone https://github.com/microsoft/vcpkg
$ ./vcpkg/bootstrap-vcpkg.sh

To install the libraries for your project, run:

$ ./vcpkg/vcpkg install [packages to install]

You can also search for the libraries you need with the search subcommand:

$ ./vcpkg/vcpkg search [search term]

In order to use vcpkg with CMake, you can use the toolchain file:

$ cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake
$ cmake --build [build directory]

With CMake, you will still need to find_package and the like to use the libraries. Check out the CMake section for more information on how best to use vcpkg with CMake, and CMake Tools for VSCode.

For any other tools, check out the integration guide.

Installing Linux Developer Tools

Across the different distros of Linux, there are different packages you'll need to install:

  • Debian, Ubuntu, popOS, and other Debian-based distributions:
$ sudo apt-get update
$ sudo apt-get install build-essential tar curl zip unzip
  • CentOS
$ sudo yum install centos-release-scl
$ sudo yum install devtoolset-7
$ scl enable devtoolset-7 bash

For any other distributions, make sure you're installing g++ 6 or above. If you want to add instructions for your specific distro, please open a PR!

Installing macOS Developer Tools

On macOS, the only thing you should need to do is run the following in your terminal:

$ xcode-select --install

Then follow along with the prompts in the windows that comes up.

You'll then be able to bootstrap vcpkg along with the quick start guide

Using vcpkg with CMake

If you're using vcpkg with CMake, the following may help!

Visual Studio Code with CMake Tools

Adding the following to your workspace settings.json will make CMake Tools automatically use vcpkg for libraries:

{
  "cmake.configureSettings": {
    "CMAKE_TOOLCHAIN_FILE": "[vcpkg root]/scripts/buildsystems/vcpkg.cmake"
  }
}

Vcpkg with Visual Studio CMake Projects

Open the CMake Settings Editor, and under CMake toolchain file, add the path to the vcpkg toolchain file:

[vcpkg root]/scripts/buildsystems/vcpkg.cmake

Vcpkg with CLion

Open the Toolchains settings (File > Settings on Windows and Linux, CLion > Preferences on macOS), and go to the CMake settings (Build, Execution, Deployment > CMake). Finally, in CMake options, add the following line:

-DCMAKE_TOOLCHAIN_FILE=[vcpkg root]/scripts/buildsystems/vcpkg.cmake

Unfortunately, you'll have to add this to each profile.

Vcpkg as a Submodule

When using vcpkg as a submodule of your project, you can add the following to your CMakeLists.txt before the first project() call, instead of passing CMAKE_TOOLCHAIN_FILE to the cmake invocation.

set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake
  CACHE STRING "Vcpkg toolchain file")

This will still allow people to not use vcpkg, by passing the CMAKE_TOOLCHAIN_FILE directly, but it will make the configure-build step slightly easier.

Tab-Completion/Auto-Completion

vcpkg supports auto-completion of commands, package names, and options in both powershell and bash. To enable tab-completion in the shell of your choice, run:

> .\vcpkg integrate powershell

or

$ ./vcpkg integrate bash # or zsh

depending on the shell you use, then restart your console.

Examples

See the documentation for specific walkthroughs, including installing and using a package, adding a new package from a zipfile, and adding a new package from a GitHub repo.

Our docs are now also available online at our website https://vcpkg.io/. We really appreciate any and all feedback! You can submit an issue in https://github.com/vcpkg/vcpkg.github.io/issues.

See a 4 minute video demo.

Contributing

Vcpkg is an open source project, and is thus built with your contributions. Here are some ways you can contribute:

Please refer to our Contributing Guide for more details.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or email [email protected] with any additional questions or comments.

License

The code in this repository is licensed under the MIT License. The libraries provided by ports are licensed under the terms of their original authors. Where available, vcpkg places the associated license(s) in the location installed/<triplet>/share/<port>/copyright.

Security

Most ports in vcpkg build the libraries in question using the original build system preferred by the original developers of those libraries, and download source code and build tools from their official distribution locations. For use behind a firewall, the specific access needed will depend on which ports are being installed. If you must install in in an "air gapped" environment, consider installing once in a non-"air gapped" environment, populating an asset cache shared with the otherwise "air gapped" environment.

Telemetry

vcpkg collects usage data in order to help us improve your experience. The data collected by Microsoft is anonymous. You can opt-out of telemetry by

  • running the bootstrap-vcpkg script with -disableMetrics
  • passing --disable-metrics to vcpkg on the command line
  • setting the VCPKG_DISABLE_METRICS environment variable

Read more about vcpkg telemetry at docs/about/privacy.md

Owner
Microsoft
Open source projects and samples from Microsoft
Microsoft
Comments
  • [new port] gtk 3.24.34 port

    [new port] gtk 3.24.34 port

    New port: gtk 3.24.34 (some software still requires GTK3)

    • What does your PR fix?

    • Which triplets are supported/not supported? Have you updated the CI baseline?

    all

    Yes

    • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

    Yes

    If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/

  • [wxwidgets] Fix usage, add cmake options

    [wxwidgets] Fix usage, add cmake options

    This PR will:

    • Automatically call wx-config and parse out cxxflags in vcpkg-cmake-wrapper.
    • Export all targets.
    • Fix the ouput path by running wx-config --libs.

    Fixes #17072.

    Upstream PR: https://github.com/wxWidgets/wxWidgets/pull/2391

  • [OpenCV] Update to v4.1.1

    [OpenCV] Update to v4.1.1

    Any feedback is welcome!

    fixes: #2065 fixes: #2749 fixes: #2799 fixes: #3095 fixes: #3418 fixes: #4160 fixes: #4601 fixes: #4725 fixes: #4758 fixes: #5101 fixes: #5557 fixes: #5876 fixes: #6728 fixes: #6994

  • [opencv4] update to v4.3

    [opencv4] update to v4.3

    It should be complete now

    Fixes: #11557 Closes: #8557 Fixes: #11138 Fixes: #10188 Closes: #8655 Closes: #8549 Closes: #3196 Fixes: #7981 Closes: #7913 Closes: #7856 Fixes: #4907 Closes: #9607 Fixes: #7572 Closes: #8175

  • More or less completely rewritten tensorflow-cc port

    More or less completely rewritten tensorflow-cc port

    • fixes static builds
    • upgrades tensorflow from v1.14 to recent v2.3, fixing #9141
    • upgrades bazel from v0.25.2 to v3.1, hopefully fixing #7995
    • requires PR #12926 (merged in this branch; need to resolve conflict once PR #12926 is merged into master)
  • [OpenMVG/OpenMVS] fix tools

    [OpenMVG/OpenMVS] fix tools

    Upgrade SuiteSparse, add new vlfeat port, restore the custom FindLAPACK (for clapack) I wrote one year ago that went lost (and with it each and every port depending on clapack was broken again on linux), remove the unnecessary FindBLAS module, and finally

    • add openMVG tools
    • fix openMVG build error
    • enable cuda on openMVS
    • handle openMVS tools properly

    along the way, it fixes: #12387 (a working qt5 was necessary to build tools cited above) and fixes many problems encountered along the way towards a working solution

  • [Qt6|6.1.0] Add new ports.

    [Qt6|6.1.0] Add new ports.

    closes #15029

    Current Status:

    • added all 6.1.0 ports which I know of (does it work? Who knows?)

    Current questions:

    • Port naming? qt6-qtbase? Only qtbase? (since qt wants to get rid of the version number anyway)
    • Features? Too many? Will never be all tested. (at least I will only be going for the default set.)

    Depends:

    • [x] #14308
    • [x] #14395 (ZSTD)
    • [x] #14530 (harfbuzz)
    • [x] another PR copying pdbs for vcpkg_copy_tools
    • [x] https://bugreports.qt.io/browse/QTBUG-88457 (qtdeclarative x64-windows-static; not in beta5; probably in beta6)
    • [x] open upstream issues
    • [x] https://bugreports.qt.io/browse/QTBUG-89204 (solved by own patch)
    • [x] https://bugreports.qt.io/browse/QTBUG-89203 (solved by own patch)
    • [x] https://bugreports.qt.io/browse/QTBUG-89280 (solved by own patch)
    • [x] https://bugreports.qt.io/browse/QTBUG-89374 (solved by own patch)
    • [x] fix import prefix correction in vcpkg_fixup_cmake_targets as mentioned in https://github.com/microsoft/vcpkg/pull/12215#discussion_r454579077. (Corrected it in another way for this PR)
    • [x] #15049
    • [x] #15144
  • [openssl] update to 3.0.2

    [openssl] update to 3.0.2

    Describe the pull request This PR updates openssl to version 3.0.2. ~~The consensus is to update openssl and to create a new port called openssl1 for future updates to openssl 1.1.1. No port depends or should ever depend on openssl1. All ports that were incompatible to OpenSSL 3 were updated or patched.~~

    See below.

    • What does your PR fix?

      Fixes #20031

    • Which triplets are supported/not supported? Have you updated the CI baseline?

      ~~Yes, skip openssl1 on all triplets~~

    • Does your PR follow the maintainer guide?

      Yes

    • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

      Yes

  • [eigen3] Update to 3.4.0

    [eigen3] Update to 3.4.0

    Describe the pull request

    • What does your PR fix?

      Updates Eigen to 3.4.0

    • Which triplets are supported/not supported? Have you updated the [CI baseline]

      all

    • Does your PR follow the [maintainer guide]

      Yes

    • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

      Yes

    I think this is good to go but have opened it as a draft as it is my first time.

  • [new port] at-spi2-atk 2.38.0 port

    [new port] at-spi2-atk 2.38.0 port

    at-spi2-atk 2.38.0 port at-spi2-core 2.44.1 port

    Describe the pull request

    • What does your PR fix?

    The port provides at-spi2-atk dependency needed by gtk3

    • Which triplets are supported/not supported? Have you updated the CI baseline?

    linux

    Yes

    • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

    Yes

    If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/

  • [android] vcpkg_configure_make correct set flags for android build

    [android] vcpkg_configure_make correct set flags for android build

    vcpkg_configure_make properly set CFLAGS, CXXFLAGS, LDFLAG, CC and CXX env variables now for android cross compilation.

    • Which triplets are supported/not supported? Mostly android triplets,

    • Have you updated the CI baseline? - no

    • Does your PR follow the maintainer guide? yes

Utility to install kexts, Frameworks and PrivateFrameworks in the System of macOS. For macOS Monterey 12 and Big Sur 11
Utility to install kexts, Frameworks and PrivateFrameworks in the System of macOS. For macOS Monterey 12 and Big Sur 11

Command-Line-SnapShot-Mounter Credit: chris1111 Apple This utility uses the macOS terminal Command Line SnapShot Mounter is an utility that allows you

Oct 14, 2022
A beginner friendly desktop UI for Tasmota flashed devices for Windows, macOS and Linux.
A beginner friendly desktop UI for Tasmota flashed devices for Windows, macOS and Linux.

TasmoManager A beginner friendly desktop UI for Tasmota flashed devices for Windows, macOS and Linux. Features Native Tasmota device discovery (via ta

Nov 20, 2022
Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2

Filament Filament is a real-time physically based rendering engine for Android, iOS, Linux, macOS, Windows, and WebGL. It is designed to be as small a

Nov 25, 2022
MTEngineSDL is a SDL2+ImGui engine for macOS, Linux and MS Windows.

Hello and welcome to the MTEngineSDL! This is an application host framework for starting custom apps created using SDL2, ImGui and OpenGL. How to comp

Jan 10, 2022
Sega Master System / Game Gear / SG-1000 emulator for iOS, macOS, Raspberry Pi, Windows, Linux, BSD and RetroArch.
Sega Master System / Game Gear / SG-1000 emulator for iOS, macOS, Raspberry Pi, Windows, Linux, BSD and RetroArch.

Gearsystem is a very accurate, cross-platform Sega Master System / Game Gear / SG-1000 emulator written in C++ that runs on Windows, macOS, Linux, BSD, iOS, Raspberry Pi and RetroArch.

Nov 21, 2022
Feather is a free, open-source Monero wallet for Linux, Tails, macOS and Windows

Feather is a free, open-source Monero wallet for Linux, Tails, macOS and Windows. It is written in C++ with the Qt framework.

Nov 13, 2022
Animated sprite editor & pixel art tool (Windows, macOS, Linux)

Aseprite Introduction Aseprite is a program to create animated sprites. Its main features are: Sprites are composed of layers & frames as separated co

Nov 22, 2022
A guide that teach you build a custom version of Chrome / Electron on macOS / Windows / Linux that supports hardware / software HEVC decoding.

enable-chromium-hevc-hardware-decoding A guide that teach you build a custom version of Chrome / Electron on macOS / Windows / Linux that supports har

Nov 22, 2022
Defender-control - An open-source windows defender manager. Now you can disable windows defender permanently.
Defender-control - An open-source windows defender manager. Now you can disable windows defender permanently.

Defender Control Open source windows defender disabler. Now you can disable windows defender permanently! Tested from Windows 10 20H2. Also working on

Nov 15, 2022
Macos-arm64-emulation - A guide for emulating macOS arm64e on an x86-based host.

macos-arm64-emulation Use the following guide to download and configure all of the necessary tools and files for emulating the macOS arm64e kernel. Th

Nov 22, 2022
Apple cctools and ld64 port for Linux, *BSD and macOS

Apple cctools and ld64 port for Linux, *BSD and macOS

Nov 15, 2022
An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.
An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.

中文版本请参看这里 MMKV is an efficient, small, easy-to-use mobile key-value storage framework used in the WeChat application. It's currently available on Andr

Nov 25, 2022
A desktop (supports macOS and Windows) implementation of uni_links plugin.

uni_links_desktop A desktop (supports macOS and Windows) implementation of uni_links plugin. uni_links_desktop Platform Support Quick Start Installati

Nov 4, 2022
The source for the Linux kernel used in Windows Subsystem for Linux 2 (WSL2)

Introduction The WSL2-Linux-Kernel repo contains the kernel source code and configuration files for the WSL2 kernel. Reporting Bugs If you discover an

Nov 17, 2022
Implements a Windows service (in a DLL) that removes the rounded corners for windows in Windows 11

ep_dwm Implements a Windows service that removes the rounded corners for windows in Windows 11. Tested on Windows 11 build 22000.434. Pre-compiled bin

Nov 14, 2022
A cross-platform (Android/iOS/Windows/macOS) cronet plugin for Flutter via `dart:ffi`

cronet_flutter A cross-platform (Android/iOS/Windows/macOS) cronet plugin for Flutter via dart:ffi

Nov 9, 2022
tabbed window manager that can tile windows inside floating containers

shod ┌───────────────────────┐ │ │ ┌─────┼────

Nov 19, 2022
Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on OpenGL 1.x-4.x supporting Windows, Linux and Mac OS X.

Visualization Library 2.2 Gallery About Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on the in

Nov 8, 2022
Signed - a 3D modeling and construction language based on Lua and SDFs. Signed will be available for macOS and iOS and is heavily optimized for Metal.
Signed - a 3D modeling and construction language based on Lua and SDFs. Signed will be available for macOS and iOS and is heavily optimized for Metal.

Signed - A 3D modeling language Abstract Signed is a Lua based 3D modeling language, it provides a unique way to create high quality 3D content for yo

Jul 4, 2022