Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OCaml Unbound Graphics Module

Tags:

Running

open Graphics;; 

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

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

On Fedora.

like image 365
Secret Avatar asked Aug 26 '13 02:08

Secret


1 Answers

This error also appears often on Mac OS X. With Homebrew this module is disabled by default on installation, so brew install ocaml will not install the Graphics module, probably due to the XQuartz dependency.

If you run brew info ocaml, it will tell you that there's a flag, namely --with-x11, that will "Install with the Graphics module". So to install/reinstall ocaml you'll have to run:

brew install Caskroom/cask/xquartz brew [re]install ocaml --with-x11 

Finally remember to check that the instance of ocaml that is running is the one in /usr/local/Cellar/objective-caml/x.yy.z[_w]/bin, and if it isn't then prepend that url to your PATH environment variable. Also remember to restart your computer after the XQuartz installation.

like image 129
Shoe Avatar answered Oct 03 '22 07:10

Shoe