#Install
opam pin ctypes https://github.com/ocamllabs/ocaml-ctypes
opam install ctypes
oasis setup
ocaml setup.ml -configure
ocaml setup.ml -build
ocaml setup.ml -install
ocamlfind ocamlc -linkpkg -g -package ctypes -package ctypes.foreign -package ctypes.stubs linenoise_bindings.ml -o linenoise_bindings.native
./linenoise_bindings.native
The example is ported from the C example. It is functionally identical
ocamlfind ocamlopt -linkpkg -g -thread -package core -package ctypes -package ctypes.foreign -package linenoise example.ml -o example.native