First export the path to ERTS:
set -x ERL_INCLUDE_PATH /home/philip/.asdf/installs/erlang/25.3/erts-13.2/include
And compile with:
zig cc -fPIC -I$ERL_INCLUDE_PATH \
-dynamiclib -undefined dynamic_lookup \
-o type_checking.so type_checking.c
You can now use the project from iex.
If available in Hex, the package can be installed
by adding type_checking
to your list of dependencies in mix.exs
:
def deps do
[
{:type_checking, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/type_checking.