本文介绍了OCaml - 找不到graphics.cma的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我使用的是OS X,而我是很确定我已经正确安装了OCaml,因为我已经使用它一个月了。所以似乎图形模块没有包含在OCaml包中。

我该如何解决这个问题,或者我怎样才能自己安装图形模块?

解决方案

首先,检查Graphics是否真的安装完成。这个库是可选的,因此它可能没有安装。有几种方法可以检查,但以下情况适用于任何情况:

  $ ls`ocamlc -where` / graphics * 

如果没有上述命令列出的文件,则图形未安装,您必须重新安装OCaml编译器启用图形。



如果像 graphics.cma 这样的文件存在,那么您必须告诉我们您如何尝试用Graphics编译你的代码。最好的答案取决于你如何编译:内部顶层,用ocamlc手工编译,或者用像ocamlbuild这样的构建工具。


When loading the Graphics module in the toplevel, I get an error saying "Cannot find graphics.cma".

I'm using OS X and I'm pretty sure I've installed OCaml correctly since I've been using it for about a month now. So it seems that the Graphics module wasn't included in the OCaml package.

How can I fix this issue, or how can I install the Graphics module myself?

解决方案

First of all, check Graphics is really installed. This library is optional and therefore it may not be installed. There are several ways to check but the following should work for any situation:

$ ls `ocamlc -where`/graphics*

If there is no file listed by the above command, Graphics is not installed and you have to reinstall OCaml compiler enabling Graphics.

If files like graphics.cma are there, then you have to show us how you try to compile your code with Graphics. The best answer varies depending on how you compile: inside toplevel, hand compiling with ocamlc, or with some build tool like ocamlbuild.

这篇关于OCaml - 找不到graphics.cma的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 16:56