Table of Contents

Frequently Asked Questions

Can I contribute a new library?

Yes! Start out by reading our contribution guidelines. If you want to contribute but don't have a particular library in mind then take a look at the list of new port requests.

Can vcpkg create pre-built binary packages? What is the binary format used by vcpkg?

Yes! See the export command.

How do I update libraries?

The vcpkg update command lists all packages which are out-of-sync with your current portfiles. To update a package, follow the instructions in the command.

How do I get more libraries?

The list of libraries is enumerated from the ports\ directory. By design, you can add and remove libraries from this directory as you see fit for yourself or your company -- see our examples on packaging zipfiles and GitHub repos.

We recommend cloning directly from GitHub and using git pull to update the list of portfiles. Once you've updated your portfiles, vcpkg update will indicate any installed libraries that are now out of date.

Can I build a private library with this tool?

Yes. Follow our packaging zlib Example for creating a portfile using a fake URL. Then, either pre-seed the downloads\ folder with a zip containing your private sources or replace the normal calls to vcpkg_download_distfile and vcpkg_extract_source_archive with functions that unpack your source code.

Can I use a prebuilt private library with this tool?

Yes. The portfile.cmake for a library is fundamentally a script that places the headers and binaries into the correct arrangement in the ${CURRENT_PACKAGES_DIR}, so to pull in prebuilt binaries you can write a portfile which directly downloads and arranges the files.

To see an example of this, look at ports\opengl\portfile.cmake which simply copies files out of the Windows SDK.

Which platforms I can target with vcpkg?

We currently target Windows Desktop (x86 and x64) as well as the Universal Windows Platform (x86, x64, and ARM). See vcpkg help triplet for the current list.

Does vcpkg run on Linux/OSX?

Yes! We continuously test on OSX and Ubuntu 16.04, however we know users have been successful with Arch, Fedora, and FreeBSD. If you have trouble with your favorite Linux distribution, let us know in an issue and we'd be happy to help!

How do I update vcpkg?

Execute git pull to get the latest sources, then run bootstrap-vcpkg.bat (Windows) or ./ (Unix) to update vcpkg.

How do I use different versions of a library on one machine?

Within a single instance of vcpkg (e.g. one set of installed\, packages\, ports\ and so forth), you can only have one version of a library installed (otherwise, the headers would conflict with each other!). For those with experience with system-wide package managers, packages in vcpkg correspond to the X-dev or X-devel packages.

To use different versions of a library for different projects, we recommend making separate instances of vcpkg and using the per-project integration mechanisms. The versions of each library are specified by the files in ports\, so they are easily manipulated using standard git commands. This makes it very easy to roll back the entire set of libraries to a consistent set of older versions which all work with each other. If you need to then pin a specific library forward, that is as easy as checking out the appropriate version of ports\<package>\.

If your application is very sensitive to the versions of libraries, we recommend checking in the specific set of portfiles you need into your source control along with your project sources and using the --vcpkg-root option to redirect the working directory of vcpkg.exe.

How does vcpkg protect my privacy?

See the Privacy document for all information regarding privacy.

Can I use my own CMake toolchain file with vcpkg's toolchain file?

Yes. If you already have a CMake toolchain file, you will need to include our toolchain file at the end of yours. This should be as simple as an include(<vcpkg_root>\scripts\buildsystems\vcpkg.cmake) directive. Alternatively, you could copy the contents of our scripts\buildsystems\vcpkg.cmake into the end of your existing toolchain file.

Can I use my own/specific flags for rebuilding libs?

Yes. In the current version, there is not yet a standardized global way to change them, however you can edit individual portfiles and tweak the exact build process however you'd like.

By saving the changes to the portfile (and checking them in), you'll get the same results even if you're rebuilding from scratch in the future and forgot what exact settings you used.

Can I get vcpkg integration for custom configurations?

Yes. While vcpkg will only produce the standard "Release" and "Debug" configurations when building a library, you can get integration support for your projects' custom configurations, in addition to your project's standard configurations.

First of all, vcpkg will automatically assume any custom configuration starting with "Release" (resp. "Debug") as a configuration that is compatible with the standard "Release" (resp. "Debug") configuration and will act accordingly.

For other configurations, you only need to override the MSBuild $(vcpkgConfiguration) macro in your project file (.vcxproj) to declare the compatibility between your configuration, and the target standard configuration. Unfortunately, due to the sequential nature of MSBuild, you'll need to add those settings much higher in your vcxproj so that it is declared before the Vcpk integration is loaded. It is recommend that the $(vcpkgConfiguration) macro is added to the "Globals" PropertyGroup.

For example, you can add support for your "MyRelease" configuration by adding in your project file:

<PropertyGroup Label="Globals">
  <vcpkgConfiguration Condition="'$(Configuration)' == 'MyRelease'">Release</vcpkgConfiguration>

Of course, this will only produce viable binaries if your custom configuration is compatible with the target configuration (e.g. they should both link with the same runtime library).

I can't use user-wide integration. Can I use a per-project integration?

Yes. A NuGet package suitable for per-project use can be generated via either the vcpkg integrate project command (lightweight linking) or the vcpkg export --nuget command (shrinkwrapped).

A lower level mechanism to achieve the same as the vcpkg integrate project NuGet package is via the <vcpkg_root>\scripts\buildsystems\msbuild\vcpkg.targets file. All you need is to import it in your .vcxproj file, replacing <vcpkg_root> with the path where you installed vcpkg:

<Import Project="<vcpkg_root>\scripts\buildsystems\msbuild\vcpkg.targets" />

How can I remove temporary files?

You can save some disk space by completely removing the packages\, buildtrees\, and downloads\ folders.

How is CMake used internally by vcpkg?

vcpkg uses CMake internally as a build scripting language. This is because CMake is already an extremely common build system for cross-platform open source libraries and is becoming very popular for C++ projects in general. It is easy to acquire on Windows, does not require system-wide installation, and legible for unfamiliar users.

Will vcpkg support downloading compiled binaries from a public or private server?

We would like to eventually support downloading precompiled binaries, similar to other system package managers.

In a corporate scenario, we currently recommend building the libraries once and distributing the entire vcpkg root directory to everyone else on the project through some raw file transport such as a network share or HTTP host. See the export command.

What Visual C++ toolsets are supported?

We support Visual Studio 2015 Update 3 and above.

Why does Visual Studio not use my libraries with user-wide integration enabled?

Enabling user-wide integration (vcpkg integrate install) changes the default for some project properties. In particular, "C/C++/General/Additional Include Directories" and "Linker/General/Additional Library Directories" are normally blank without user-wide integration. With integration, a blank value means that the augmented default supplied by vcpkg is overridden, and headers/libraries will not be found. To reinstate the default, set the properties to inherit from parent.

Why not NuGet?

NuGet is a package manager for .NET libraries with a strong dependency on MSBuild. It does not meet the specific needs of Native C++ customers in at least three ways.

Why not Conan? is a publicly-federated, project-centric, cross-platform, C++ package manager written in python. Our primary differences are:

Why not Chocolatey?

Chocolatey is an excellent system for managing applications. However, it is not currently designed to acquire redistributable developer assets and help you with debugging. vcpkg, in comparison, is designed to get you the libraries you need to build your application and help you deliver through any platform you'd like (including Chocolatey!).