Prerequisites
- C compiler (GCC, Clang, MSVC, or compatible)
- CMake (optional, for building from source)
- Python 3.x (for building from source)
Installation Options
Option 1: Pre-built Binaries (Recommended)
Download the latest Z3 release for your platform from the GitHub Releases page.include/z3.h- Main C API headerinclude/z3_*.h- Additional API headersbin/libz3.so(Linux) /bin/libz3.dylib(macOS) /bin/libz3.dll(Windows) - Shared library
Option 2: Build from Source
Building from source gives you the latest features and allows customization.Option 3: Package Managers
Verify Installation
Create a test filetest_z3.c:
test_z3.c
Linking with Z3
GCC/Clang
CMake
Add to yourCMakeLists.txt:
Visual Studio
- Add include directory: Project Properties → C/C++ → General → Additional Include Directories:
C:\z3\include - Add library directory: Project Properties → Linker → General → Additional Library Directories:
C:\z3\bin - Add library: Project Properties → Linker → Input → Additional Dependencies:
libz3.lib
Runtime Configuration
Linux/macOS
If Z3 is not installed in a standard location, setLD_LIBRARY_PATH (Linux) or DYLD_LIBRARY_PATH (macOS):
Windows
Ensurelibz3.dll is in your PATH or in the same directory as your executable.
Troubleshooting
Header Not Found
-I.
Library Not Found
-L or install Z3 to a standard location.
Runtime Library Error
LD_LIBRARY_PATH or run sudo ldconfig after installation.
Next Steps
Getting Started
Learn the basics of the Z3 C API
API Reference
Explore the complete C API documentation
