defin is a system tool that detects and installs missing dependencies for C++ projects by analyzing #include directives.
- Core code is under a custom non-redistributable license. See LICENSE.txt
- JSON database (
json-db/) is licensed under the MIT License. See json-db/LICENSE-json.txt - Includes TinyProcessLibrary, under the MIT License. See tiny-process-library/LICENSE-tinyprocess.txt
- Parses source code for missing headers
- Maps includes to system packages via JSON
- Installs packages using apt, pacman, and more
- CLI-first, scriptable
- Supported OS: Linux only
- Tested on: Arch, Debian, Fedora (others may work)
- Requires: CMake 3.10+, a C++17-compatible compiler, and a working package manager (e.g. apt, pacman, dnf)
git clone https://github.com/umangsys-dev/defin
cd defin
mkdir build
cmake -S . -B build/
cmake --build build
sudo cmake --install build- Recursively scans all
.cpp,.hpp,.c, and.hfiles in the given directory - Detects used
#includeheaders - Maps them to logical libraries and installable packages
- Installs missing packages automatically using your system's package manager
This is the main command for resolving and fixing missing dependencies.
- Lists missing packages (headers used in the source but packages not installed)
- Does not perform any installation
- Ideal for dry runs or CI integration
- Lists present packages (headers used and already available on your system)
- Useful for auditing project dependencies
The directory you pass contains C++ source code:
-
Any combination of
.cpp,.hpp,.c, or.hfiles -
No need for a compiled binary
(depin directly parses your source code to extract
#includedirectives.) -
Use
sudosince actual package installation requires root -
Supported package managers:
apt,pacman, anddnf
- Check out json-db/Contributing.md.