【发布时间】:2012-11-07 15:18:59
【问题描述】:
我正在尝试用 2 .ml 编译一个项目,其中一个是遵循这种格式的模块
module Mymodule =
struct
...
end;;
我还为 myModule 创建了一个 .mli
module Mymodule =
sig
...
end
但是现在当我在 main.ml 中调用 Mymodule.myfunction 时,我得到了"Unbound value Mymodule.myfunction"。
这是我的 makefile(我也有标准的 OcamlMakeFile):
RESULT= result
SOURCES= Mymodule.ml main.ml
LIBS= bigarray sdl sdlloader sdlttf sdlmixer
INCDIRS= +sdl
include OCamlMakefile
我搜索并尝试了一些东西,但没有任何效果:(
感谢您的回答,我按照您链接的教程进行操作,但现在我遇到了 SDL 链接问题:
File "testsdl_2.ml", line 1, characters 0-1:
Error: No implementations provided for the following modules:
Sdl referenced from testsdl_2.cmx
Sdlloader referenced from testsdl_2.cmx
Sdlvideo referenced from testsdl_2.cmx
我正在使用这一行来编译:
ocamlopt -I +sdl -o testsdl mymodule.cmx main.ml
【问题讨论】: