Undefined symbol caml_call_gc after ocamlmklib?
I'm trying to build a library for installation, but I am not sure what this error means:
$ ocamlmklib -custom -linkall 开发者_如何学运维 ociml.ml -o ociml
$ ocaml
Objective Caml version 3.12.0
# #load "ociml.cma";;
Cannot load required shared library dllociml.
Reason: ./dllociml.so: ./dllociml.so: undefined symbol: caml_call_gc.
I guess I must just be missing some options on the command line? Thanks!
ocamlmklib without C objects will not generate dll*.so
at all, and with -custom it will not generate any *.so
either. So your example is not full/self-containing and so it is hard to guess what is wrong. Look at the existing bindings for examples.
A relatively random suggestion here as I can't reproduce locally, but have you tried -lcamlrun
? It is supposed to link the OCaml runtime (-lasmrun
for native code).
精彩评论