Linkdeps(3) OCaml library Linkdeps(3)

# [NAME](#NAME)

Linkdeps - no description

# [Module](#Module)

Module Linkdeps

# [Documentation](#Documentation)

Module **Linkdeps**  
: **sig end**

*type t*

The state of the linking check. It keeps track of compilation units provided and required so far.

*type compunit* = **string**

*type filename* = **string**

*val create* : **complete:bool -&gt; t**

**create ~complete** returns an empty state. If **complete** is **true** , missing compilation units will be treated as errors.

*val add* : **t -&gt;** **filename:filename -&gt;** **compunit:compunit -&gt;** **provides:compunit list -&gt; requires:compunit list -&gt; unit**

**add t ~filename ~compunit ~provides ~requires** registers the compilation unit **compunit** found in **filename** to **t** .

\- **provides** are units and sub-units provided by **compunit**

\- **requires** are units required by **compunit**

**add** should be called in reverse topological order.

*val required* : **t -&gt; compunit -&gt; bool**

**required t compunit** returns **true** if **compunit** is a dependency of previously added compilation units.

*type compunit\_and\_source* = {  
compunit : **compunit** ;  
filename : **filename** ;  
}

*type error* =  
| Missing\_implementations **of** **(compunit * compunit\_and\_source list) list**  
| Wrong\_link\_order **of** **(compunit\_and\_source * compunit\_and\_source list) list**  
| Multiple\_definitions **of** **(compunit * filename list) list**

*val check* : **t -&gt; error option**

**check t** should be called once all the compilation units to be linked have been added. It returns some error if:

-There are some missing implementations and **complete** is **true**

-Some implementation appear before their dependencies

*val report\_error* : **print\_filename:string Format\_doc.printer -&gt;** **error Format\_doc.format\_printer**

*val report\_error\_doc* : **print\_filename:string Format\_doc.printer -&gt; error Format\_doc.printer**

2026-09-04 OCamldoc

---

Document: Linkdeps(3o) from ocaml 5.5.1-r0 (Chainguard OS)
Source: https://github.com/ocaml/ocaml
