Reputation: 121
I have installed OCaml on my xfce and now I want to do some graphics program. The problem is that I don't know how I can install graphics.cma ( I think it's this file that I need but i'm not sure ).
I have research on Google and in This forum but I can't find it..
After little search, I see that i have graphics.cma and graphics.cmxa .
I found this with ls $(ocamlc -where) | egrep cmx?a
I don't know why but yet, my graphics function work at all. Sorry for inconvenience.
Thanks for helping me guys. Have a nice day
Upvotes: 1
Views: 1003
Reputation: 12322
You have already installed the graphics module.
On Debian based systems the ocaml package is split into ocaml-base-nox and ocaml-base. The later contains the graphics module while the former is trimmed down.
The ocaml package is a meta package that depends on both of those and the description says (at the end):
This package contains everything needed to develop OCaml applications,
including the graphics libraries.
So you are all set to play with graphics. Juliens answere of installing ocamlfind is a good idea though as it makes using graphics and other modules easier.
Upvotes: 1
Reputation: 376
I would suggest installing and using ocamlfind
in order to not have to worry about library location:
ocamlfind ocamlc -package graphics -linkpkg test.ml
will compile your file with the right files loaded. You can also load the package in the toplevel using
#use "topfind";;
#require "graphics";;
Upvotes: 2