Ocaml未绑定图形模块 [英] Ocaml Unbound Graphics Module

查看:132
本文介绍了Ocaml未绑定图形模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行

open Graphics;;

ocaml中的

返回错误,表示它是未绑定的模块.在终端(ocaml)中运行它会返回相同的结果.

in ocaml returns an error, saying it is an unbound module. Running it in terminal (ocaml) returns the same thing.

这是否意味着我的图形模块未随ocaml软件包一起安装?如果可以,该如何安装模块?

Does this mean my Graphics Module was somehow not installed with the ocaml package? If so, how can I install the module?

在Fedora上.

推荐答案

图形模块默认情况下未就绪.您需要手动加载.在顶层:

Graphics module is not ready by default. You need to load it manually. In toplevel:

$ ocaml
       OCaml version blahblah
# #load "graphics.cma";;
# open Graphics;;

或者您可以在命令行中指定它:

or you can specify it at the command line:

$ ocaml graphics.cma
       OCaml version blahblah
# open Graphics;;

我不了解Fedora,但是如果以上操作失败,则说明您的环境中未真正安装图形.

I do not know about Fedora but if the above fails, graphics is not really installed in your environment.

这篇关于Ocaml未绑定图形模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆