代码之家  ›  专栏  ›  技术社区  ›  SoftTimur

未实现的javascript原语caml_pure_js_expr(再次)

  •  0
  • SoftTimur  · 技术社区  · 6 年前

    我在ocaml中有一个项目很早以前就可以在ubuntu中编译了。今天,我想接下这个项目,试着把它编译成 macOS Mojave 10.14.2 .

    ocaml --version 收益率 The OCaml toplevel, version 4.07.1 , js_of_ocaml --version 收益率 3.3.0 , npm --version 收益率 6.7.0 , node --version 收益率 v8.9.3 .

    makefile 工作良好并产生 analyze . 但是 ./analyze test.ev 收益率 Unimplemented Javascript primitive caml_pure_js_expr! .

    有人知道问题出在哪里吗?

    编辑1:

    作为我的 分析 是大的,我测试一个小的例子,可以重现错误。我写 cubes.ml 如下:

    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
    

    以下两个命令生成良好 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 返回井 hello 然而 ./T 收益率 未实现的javascript原语caml_pure_js_expr!

    0 回复  |  直到 6 年前