我正在将 OCaml Makefile 用于我正在进行的项目并且我有以下模块
DynamicTree.ml
Huffman_Dynamic.ml
它使用 DynamicTree
Huffman_Static.ml
main.ml
它同时使用 Huffman_Static
和 Huffman_Dynamic
.
这是我的制作文件:
# 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
结果来自 ocamlopt -c -dtypes huffman_dynamic.ml
由 Makefile 生成。
Ocaml Makefile 网页 states that it generates自动依赖,我这里有什么遗漏吗?
谢谢。
最佳答案
你的名字大写正确吗?在您的帖子中,您同时使用 DynamicTree.ml
和 dynamictree.ml
。
您确定问题来自 Makefile 吗?真的有 DynamicTree.ml
导出的 create_anchor_leaf
函数吗?没有 .mli
隐藏它?
关于makefile - OCaml makefile依赖问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4320543/