4

我只是在使用 OCaml 4.02(使用 opam)尝试我的代码,我收到很多这样的警告:

File "_tags", line 14, characters 121-134:
Warning: the tag "link(utils.o)" is not used in any flag
declaration, so it will have no effect; it may be a typo.
Otherwise use `mark_tag_used` in your myocamlbuild.ml to
disable this warning.

但它定义在myocamlbuld.ml

pdep ["link"] "link" (fun param -> [param]);

我可以通过以下方式摆脱它:

mark_tag_used("link(utils.o)");

但每次使用标签时,我都需要一条这样的线!此外,我的代码将不会使用早期版本的 OCaml 构建。一般解决方法是什么?

(完整代码在https://github.com/0install/0install

4

1 回答 1

0

当我这样做时,我摆脱了同样的警告

dispatch @@ MyOCamlbuildBase.dispatch_combine [
  begin function
    (* ... *)
  end;
  dispatch_default
]
;;

代替

dispatch 
begin function (* ... *)

在我的myocamlbuild.ml并重新运行oasis setup。YMMV

于 2014-10-20T14:47:26.793 回答