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

查看:21
本文介绍了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 上.

On 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天全站免登陆