I have a project in OCaml that could be compiled in Ubuntu long time ago. Today, I want to pick up the project and try to compile it in macOS Mojave 10.14.2
.
ocaml --version
returns The OCaml toplevel, version 4.07.1
, js_of_ocaml --version
returns 3.3.0
, npm --version
returns 6.7.0
, node --version
returns v8.9.3
.
makefile
works fine and generates analyze
. But ./analyze test.ev
returns Unimplemented Javascript primitive caml_pure_js_expr!
.
Does anyone know where may be the problem?
Edit 1:
As my analyze
is big, I test a small example that could reproduce the error. I write cubes.ml
as follows:
let () =
let oneArgument (a: int) = a + 100 in
Js_of_ocaml.Js.Unsafe.global##.jsOneArgument := Js_of_ocaml.Js.wrap_callback oneArgument;
print_string "hello\n";
exit 0
The following two commands generate well T
:
ocamlfind ocamlc -g -package js_of_ocaml.ppx -linkpkg cubes.ml -o T
js_of_ocaml --debuginfo --sourcemap --pretty T -o cubes.js
node cubes.js
returns well hello
, however ./T
returns Unimplemented Javascript primitive caml_pure_js_expr!