# Install snapdir for C/C++ The C/C++ binding is a header-only RAII wrapper (`snapdir.hpp`) over the snapdir C ABI. It gives you the full snapdir core — the same BLAKE3 walk, manifests, and 64-character snapshot IDs as the CLI — built from source against the `snapdir-ffi` crate. There is no C++ package registry, so you compile the C ABI once and link your program against it. ## Install The published artifact is the [`snapdir-ffi`](https://crates.io/crates/snapdir-ffi) **source crate** on crates.io. Build the static library, generate the C header with `cbindgen`, then compile your program against it with `snapdir.hpp`: ```sh # needs a Rust toolchain + cbindgen (apk add rust cargo cbindgen on Alpine) # fetch the snapdir-ffi source (e.g. `cargo fetch`/vendor), then: cargo build --release # -> target/release/libsnapdir_ffi.a cbindgen --config cbindgen.toml --crate snapdir-ffi --output snapdir.h . g++ -std=c++20 app.cpp -I. -L. -lsnapdir_ffi -lpthread -ldl -lm -o app ``` You need a C++17 compiler (C++20 tested — the header uses `std::optional`, `std::filesystem`, and `std::future`), a Rust toolchain, and `cbindgen`. Drop `snapdir.hpp` next to `snapdir.h` and include it. This exact flow is CI-verified from crates.io on a blank-slate `alpine:3.20` (musl) image before every release. ## Platform support Every binding runs on Linux (glibc and Alpine/musl, x64 and arm64) and macOS; Windows is unsupported, since snapdir is Unix-only. | Platform | Supported | | --- | --- | | Linux glibc (x64 + arm64) | yes | | Linux musl / Alpine (x64 + arm64) | yes | | macOS | yes | | Windows | no | The one binding-wide exception is **Java**, which is glibc-only today (musl support is planned for 1.11.1). The C/C++ binding has no such caveat — it builds and links on glibc and musl alike. ## Next - [C/C++ quickstart](/quickstart/cpp/) — a 60-second push → pull round-trip. - [snapdir for C/C++](/bindings/cpp/) — the full binding reference.