我正在将我的应用程序从 OCaml 4.02.3 移植到 4.03.0。
假设您有以下内容lexer.ml
:
type t = T [@@deriving sexp]
let () =
sexp_of_t |> ignore;
print_endline "hai"
我正在尝试按以下方式运行它:
ocamlbuild -use-ocamlfind -pkg ppx_sexp_conv -cflags '-w @a-4-31' lexer.byte --
但我收到以下错误:
Warning 31: files lexer.cmo and /Users/vladimir/.opam/4.03.0+flambda/lib/ocaml/compiler-libs/ocamlcommon.cma(Lexer) both define a module named Lexer
File "_none_", line 1:
Error: Some fatal warnings were triggered (1 occurrences)
我知道它compiler-libs
也有一个名为的模块Lexer
,但是它与我的词法分析器发生冲突:
我不是想链接编译器库。我知道它由 使用
ppx_sexp_conv
,但它是一个预处理器,它不需要将编译器库链接到我的应用程序中。警告 31 只是一个警告,我明确地试图将其 (
-w @a-4-31
) 视为一种解决方法,但这不起作用。它曾经在 4.02.3 中工作。