OCaml makefile依赖问题

时间:2010-12-01 01:51:55

标签: makefile ocaml

我正在使用OCaml Makefile进行我正在进行的项目,我有以下模块

DynamicTree.ml

使用Huffman_Dynamic.ml

DynamicTree

Huffman_Static.ml

main.ml同时使用 Huffman_Static Huffman_Dynamic

这是我的make文件:

# put here the names of your source files (in the right order)
SOURCES = huffman_static.ml dynamictree.ml huffman_dynamic.ml main.ml

# the name of the resulting executable
RESULT  = huffman

# generate type information (.annot files)
ANNOTATE = yes

# make target (see manual) : byte-code, debug-code, native-code
all: native-code

include OCamlMakefile

当我尝试制作项目时,我得到一个Unbound value DynamicTree.create_anchor_leaf,它来自Makefile生成的ocamlopt -c -dtypes huffman_dynamic.ml

Ocaml Makefile wepage states that it generates自动依赖,我在这里遗漏了什么吗?

谢谢。

1 个答案:

答案 0 :(得分:8)

您姓名的大小写是否正确?在您的帖子中,您同时使用DynamicTree.mldynamictree.ml

您确定问题来自Makefile吗? create_anchor_leaf导出了真正的DynamicTree.ml函数吗?没有.mli隐藏它吗?