简体   繁体   English

Ocamlbuild找不到Ocamlbuild_js_of_ocaml cmx文件

[英]Ocamlbuild can't find Ocamlbuild_js_of_ocaml cmx file

I'm starting an web development project and was hoping to use Js_of_ocaml. 我正在启动一个Web开发项目,并希望使用Js_of_ocaml。 However, when attempting to use OCamlbuild as my build tool, I've encountered the following error: 但是,当尝试使用OCamlbuild作为构建工具时,遇到了以下错误:

Warning 58: no cmx file was found in path for module Ocamlbuild_js_of_ocaml, and its interface was not compiled with -opaque 警告58:在模块Ocamlbuild_js_of_ocaml的路径中找不到cmx文件,并且其接口未使用-opaque进行编译

My Makefile is as follows: 我的Makefile如下:

.SUFFIXES: .ml .mli .byte .js
OFLAGS= -use-ocamlfind \
        -plugin-tag 'package(js_of_ocaml.ocamlbuild)'
%.js:
    ocamlbuild $(OFLAGS) $<

clean:
    ocamlbuild -clean
    find . -iname *.js -delete
    rm -rf build

My myocamlplugin.ml file contains the text from the documentation: 我的myocamlplugin.ml文件包含文档中的文本:

let _ = Ocamlbuild_plugin.dispatch Ocamlbuild_js_of_ocaml.dispatcher

Finally, I'm trying to compile a minimal test file: 最后,我尝试编译一个最小的测试文件:

open Js;;
let rec fact = function
  | 0 -> 1
  | n -> n * (fact (n - 1));;

print_int (fact 10);;

If it helps, I'm on Arch Linux running OCaml 4.03.0 and ocamlbuild 0.9.3 . 如果有帮助,我在运行OCaml 4.03.0ocamlbuild 0.9.3的 Arch Linux上。
Thanks in advance! 提前致谢!

This is a warning, not an error, and you can safely ignore it. 这是警告,不是错误,您可以放心地忽略它。

It is here to tell you that the compiler might miss optimizations (since it needs .cmx to do inlining) ... but you really don't care about optimizations for the ocamlbuild plugin, so it's fine. 这里是要告诉您,编译器可能会错过优化(因为它需要.cmx进行内联)...但是您实际上并不关心ocamlbuild插件的优化,所以很好。

You can put a bug report on js_of_ocaml's bugtracker, though. 不过,您可以在js_of_ocaml的bugtracker上提交错误报告。 .cmx files should be installed for everything. .cmx文件应为所有内容安装。 ;) ;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM