我试着用ocamldoc记录我的一个小项目。
我有一个主.ml文件,它opens另外两个.ml文件。
$ ocamldoc -html included1.ml included2.ml工作正常,但是当我添加包含文件时,就像
$ ocamldoc -html included1.ml included2.ml including.ml我明白了:
File "including.ml", line 5, characters 5-16:
Error: Unbound module Included1
1 error(s) encountered 我从ocamldoc文件中看到,打开模块是非常好的,直到没有冲突出现。
我该怎么做?
发布于 2016-10-07 16:16:41
模块可以使用其他模块,但是它需要能够看到这些模块的编译接口。因此,在您的示例中,首先需要编译.ml文件以生成.cmi文件。然后,您需要向ocamldoc指出这些文件在哪里。所以像这样的事情应该可以做到:
ocamlc -c included1.ml
ocamlc -c included2.ml
ocamlc -c -I . including.ml
ocamldoc -html -I . included1.ml included2.ml including.ml注意,通常为每个模块创建.mli文件是一种很好的(必要的)实践--文档和ocamldoc --而不是.ml文件。
https://stackoverflow.com/questions/39921328
复制相似问题