C++ Dependency Management with Conan and vcpkg
Why C++ never got a canonical package manager, and how Conan 2 and vcpkg manifest mode close the gap — package IDs, triplets, baselines, lockfiles, and binary caching at scale.
Overview
Why C++ never settled packaging
Every other mainstream language settled its packaging question long ago. C++ did not, because of the ABI, the application binary interface: the rules for how compiled code lays out data and calls functions. A Python wheel works on any CPython of the right minor version, but a C++ static library works only with a compatible compiler, standard library, language standard, exception model and set of ABI-affecting flags.
So a C++ package manager cannot look a binary up by name and version alone. It builds a cache key from two halves, the package and its version on one side and the build configuration on the other, and it asks a binary remote for that key.
> [!IMPORTANT] No single binary works everywhere, so a C++ package manager must treat build configuration as part of the package identity. Understanding that sentence is the difference between using these tools and fighting them.
Key concepts
- Package ID (Conan)
- ABI hash (vcpkg)
- Profile (Conan)
- Triplet (vcpkg)
- builtin-baseline
- conan.lock
- Package ID mode
- Generator versus toolchain file
Interview questions
- Explain the Conan package ID. What goes into it, and what happens when a dependency version changes?
- Compare Conan 2 and vcpkg manifest mode. When would you pick each, and how do you pin versions in both?
- Your CI binary cache hit rate dropped from 95 percent to near zero overnight and nobody changed a dependency. How do you diagnose it?
- When is CMake FetchContent the right answer, and what does it cost you at scale?
- A prebuilt dependency from your artifact store causes crashes on one platform but not others. Walk through the diagnosis.
Sign up free to read the full topic
More DevOps topics
Start free on Cariara · Coding problems · System design studio