Module 编译Ocaml游戏时出现未绑定模块事件错误

Module 编译Ocaml游戏时出现未绑定模块事件错误,module,compiler-errors,ocaml,Module,Compiler Errors,Ocaml,我是Ocaml新手,我正试图从中编译俄罗斯方块游戏。我正在使用ocaml版本4.00.0的Windows7,但是当我尝试使用下面的命令进行编译时。我得到这个错误 C:\Users\WASSWA SAM\ocaml stuff\mltetris>ocamlc -pp camlp4o -o tetris.exe human. ml game.ml play.ml tetris.ml tetris.mli File "play.ml", line 21, characters 16-26: Er

我是Ocaml新手,我正试图从中编译俄罗斯方块游戏。我正在使用ocaml版本4.00.0的Windows7,但是当我尝试使用下面的命令进行编译时。我得到这个错误

C:\Users\WASSWA SAM\ocaml stuff\mltetris>ocamlc -pp camlp4o -o tetris.exe human.
ml game.ml play.ml tetris.ml tetris.mli
File "play.ml", line 21, characters 16-26:
Error: Unbound module Event
事件模块不应该是标准发行版的一部分吗。我使用这个命令检查了库

C:\Users\WASSWA SAM\ocaml stuff\mltetris>ocamlfind list
bigarray            (version: [distributed with Ocaml])
camlp4              (version: [distributed with Ocaml])
camlp4.exceptiontracer (version: [distributed with Ocaml])
camlp4.extend       (version: [distributed with Ocaml])
camlp4.foldgenerator (version: [distributed with Ocaml])
camlp4.fulllib      (version: [distributed with Ocaml])
camlp4.gramlib      (version: [distributed with Ocaml])
camlp4.lib          (version: [distributed with Ocaml])
camlp4.listcomprehension (version: [distributed with Ocaml])
camlp4.locationstripper (version: [distributed with Ocaml])
camlp4.macro        (version: [distributed with Ocaml])
camlp4.mapgenerator (version: [distributed with Ocaml])
camlp4.metagenerator (version: [distributed with Ocaml])
camlp4.profiler     (version: [distributed with Ocaml])
camlp4.quotations   (version: [distributed with Ocaml])
camlp4.quotations.o (version: [distributed with Ocaml])
camlp4.quotations.r (version: [distributed with Ocaml])
camlp4.tracer       (version: [distributed with Ocaml])
compiler-libs       (version: [distributed with Ocaml])
compiler-libs.bytecomp (version: [distributed with Ocaml])
compiler-libs.common (version: [distributed with Ocaml])
compiler-libs.optcomp (version: [distributed with Ocaml])
compiler-libs.toplevel (version: [distributed with Ocaml])
dbm                 (version: [distributed with Ocaml])
dynlink             (version: [distributed with Ocaml])
findlib             (version: 1.3.3)
graphics            (version: [distributed with Ocaml])
labltk              (version: [distributed with Ocaml])
num                 (version: [distributed with Ocaml])
num-top             (version: 1.3.3)
num.core            (version: [internal])
ocamlbuild          (version: [distributed with Ocaml])
stdlib              (version: [distributed with Ocaml])
str                 (version: [distributed with Ocaml])
threads             (version: [distributed with Ocaml])
threads.posix       (version: [internal])
unix                (version: [distributed with Ocaml])

缺少什么我不知道是什么问题。

是的,
事件
是标准库的一部分

在我的机器上,以下命令序列正在工作:

ocamlopt -thread  -c human.ml
ocamlopt -thread  -c game.ml
ocamlopt -thread  -c tetris.ml
ocamlopt -thread  -c play.ml
ocamlopt -thread  unix.cmxa threads.cmxa graphics.cmxa human.cmx game.cmx tetris.cmx play.cmx   -o tetris.opt


与手动编译每个文件(在本例中可能有效)不同,更长期的方法是使用提供的Makefile,只需发出命令

make
(上述命令实际上是
make
运行的命令)。
似乎您在Windows下,在这种情况下,一个选项是安装Cygwin,它提供了一个版本的
make
。Cygwin本身就是一个完整的章节,请在开始之前阅读它。

事件模块似乎是threads工具的一部分。手册上说:

使用系统线程的程序必须按如下方式链接:


我现在在尝试您的代码时出错。”i686-w64-mingw32-as“未被识别为内部或外部命令、可操作程序或批处理文件。文件“human.ml”,第1行:错误:汇编器错误,在文件C:\Users\WASSWA~1\AppData\Local\Temp\camlasmcb1c14中保留输入。sLet首先尝试保持与以前的尝试接近。我会尝试将所需选项和编译的模块添加到几乎正常工作的命令中:try
ocamlc-custom-thread-pp camlp4o-o tetris.exe unix.cma threads.cma graphics.cma human.ml game.ml tetris.mli tetris.ml play.ml
(顺便说一句,为什么要添加
-pp camlp4o
?)。
   ocamlc -thread other options unix.cma threads.cma other files  
   ocamlopt -thread other options unix.cmxa threads.cmxa other files