OCaml:如何编译/制作文件扩展名为.ml.x的程序?

时间:2019-03-17 17:32:06

标签: makefile ocaml ocamlbuild

我下载了一个包含以下文件的项目:

    div id="photodiv">

    </div>

    <input type="button" value="1" id="one">
    <input type="button" value="2" id="two">
    <input type="button" value="3" id="three">
    <input type="button" value="4" id="four">

我可以通过执行

来编译一些不依赖于其他文件的文件
assert.mli
assert.ml
deque.ml
deque.mli
eventloop.ml
eventloop.mli
g.ml
gctx.ml
gctx.mli
gdemo.html
gdemo.ml
gdemo.mli
g-js.ml.x
g-native.ml.x
lightbulb.html
lightbulb.ml
lightbulb.mli
Makefile
paint.html
paint.ml
paint.mli
widget.ml
widget.mli
widgetTest.ml
widgetTest.mli

例如。但是,$ ocamlc assert.mli assert.ml 取决于eventloop.ml,而widget.ml取决于widget.mlgctx.ml似乎依赖于模块gctx,我认为它是一个图形库。当我窥视G时,我看到它确认该文件正在导入图形库的固定版本。但是,我不知道如何使用该文件。我在终端机中尝试了一些猜测,但无济于事。一个例子是

g-js.ml.x

我尝试谷歌搜索“如何编译ocaml“ .ml.x”“,但没有提出任何建议,我不确定是否应该搜索其他内容,或者是否没有太多东西关于如何处理这些文件。

我也在终端$ ocamlc g-js.ml.x g.ml 中尝试过并收到错误

$ make -f Makefile

查找此错误,其他人发现通过更新OPAM的库,尤其是更新+ ocamlfind ocamldep -package js_of_ocaml-lwt.graphics -package js_of_ocaml-lwt -package js_of_ocaml -modules gdemo.mli > gdemo.mli.depends ocamlfind: Package `js_of_ocaml-lwt.graphics' not found Command exited with code 2. Compilation unsuccessful after building 1 target (0 cached) in 00:00:00. Makefile:51: recipe for target 'gdemo.byte' failed make: *** [gdemo.byte] Error 10 来解决此错误,但这对我来说没有解决。


编辑:按照注释中的某些说明进行操作后,尝试制作Makefile时出现新的错误消息:

cppo_ocamlbuild

0 个答案:

没有答案
相关问题