OCaml - Cannot find graphics.cma

前端 未结 2 1024
有刺的猬
有刺的猬 2021-01-14 08:48

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 corr

2条回答
  •  一整个雨季
    2021-01-14 09:44

    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.

提交回复
热议问题