# `ExMujoco.Loader`
[🔗](https://github.com/d-led/ex.mujoco/blob/main/lib/ex_mujoco/loader.ex#L1)

Loading the NIF, and refusing to go on if it does not match the headers it was
generated from.

Called from `ExMujoco.Native`'s `@on_load` after the NIF is in, so a mismatch is
a module that will not load — which is loud — rather than a physics run that is
quietly a different version.

The loading itself has to happen in `ExMujoco.Native`: `:erlang.load_nif` only
loads a library whose `ERL_NIF_INIT` name is the calling module's.

# `check`

```elixir
@spec check() :: :ok | {:error, String.t()}
```

Whether the library and the headers agree.

Both numbers are `mjVERSION_HEADER`-shaped: `4000001` is 4.0.1.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
