0

I need to use Sexplib in my program. I tried

ocamlc sexplib.cma prog.ml
Error: Unbound module Sexplib

and I got the error. But I can use Sexplib in top level if I load ppx_sexp_conv package first:

#require "ppx_sexp_conv";;
open Sexplib;;

So I also tried this:

ocamlfind ocamlc -package ppx_sexp_conv sexplib.cma prog.ml
Error: Error while linking /Users/neko/.opam/system/lib/sexplib/sexplib.cma(Sexplib):
The external function `caml_ba_get_1' is not available

I have no idea what this means and what I need to do now... Can anyone help?

2 Answers2

0

caml_ba_get_1 is a function of the Bigarray module. You might try linking in the bigarray package (or bigarray.cma). On my system the function is defined in libbigarray.a.

Jeffrey Scofield
  • 65,646
  • 2
  • 72
  • 108
0

The linker is missing C externals used by your package. You should be able to fix this by passing -linkpkg to ocamlfind so that it passes the relevant arguments to the linker:

ocamlc -package ppx_sexp_conv -linkpkg prog.ml
Étienne Millon
  • 3,018
  • 11
  • 27