Installation
How to install ZAP C++ on various platforms
Installation
This guide covers installing ZAP C++ on various platforms.
System Requirements
- C++20 compatible compiler (GCC 10+, Clang 12+, MSVC 2019+)
- CMake 3.16 or later
- pkg-config (optional, for system integration)
Package Managers
macOS (Homebrew)
Ubuntu/Debian (apt)
Arch Linux (AUR)
vcpkg
Or install directly:
Conan
Or install directly:
Building from Source
The recommended way to install ZAP C++ from source:
CMake Options
| Option | Default | Description |
|---|---|---|
BUILD_TESTING | ON | Build test suite |
BUILD_SHARED_LIBS | OFF | Build shared libraries |
ZAP_LITE | OFF | Build lite version (no RPC, reflection) |
WITH_OPENSSL | ON | Enable TLS support via OpenSSL |
WITH_ZLIB | ON | Enable compression support |
Example: Minimal Build
Docker
A Docker image with ZAP C++ pre-installed is available:
Verifying Installation
After installation, verify that the tools are available:
CMake Integration
Finding the Package
Compiling Schema Files
FetchContent Integration
Include ZAP C++ directly in your project:
Troubleshooting
CMake cannot find zap
If CMake cannot find the installed library:
Linker errors with shared libraries
Update the library path:
Compiler version issues
Ensure you have a C++20 compatible compiler:
Next Steps
- Learn the Schema Language
- Understand Serialization