[ocaml] fix minor bugs on forward link reference resolution
[ocaml] add error codes; fix a bug on link reference solution; update darwin binary