gpt4 book ai didi

module - 编译Ocaml游戏时未绑定(bind)模块事件错误

转载 作者:行者123 更新时间:2023-12-02 10:45:37 26 4
gpt4 key购买 nike

我是 Ocaml 的新手,我试图从 http://lambda-diode.com/software/ocaml/ 编译游戏 mltetris .我正在使用带有 ocaml 版本 4.00.0 的 Windows 7,但是当我尝试使用下面的命令进行编译时。我收到这个错误

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])

缺少什么我不知道出了什么问题。

最佳答案

是的,Event是标准库的一部分。

在我的机器上,以下命令序列正在运行:

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 本身就是一个完整的章节,在开始之前阅读它。

关于module - 编译Ocaml游戏时未绑定(bind)模块事件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13299235/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com