0

I reviewed this thread OCaml - Cannot find graphics.cma but unfortunately wasn't able to resolve it finding the recommendation here. I'm on Catalina macos and when running ocamlbuild foo.byte, I get this error:

+ ocamlc.opt str.cma graphics.cma -thread threads.cma foo.cmo -o foo.byte
File "_none_", line 1:
Error: Cannot find file graphics.cma
Command exited with code 2.
Compilation unsuccessful after building 3 targets (0 cached) in 00:00:00.

I tried installing graphics via opam and installing xquartz as well manually after removing the brew version of xquartz which, enabled me to install graphics just fine but still gives me the error above.

reactor
  • 1,722
  • 1
  • 14
  • 34
  • Out of curiosity, why not use Dune? – Yawar Jul 19 '20 at 02:38
  • for no particular reason. I didn't know about dune until now. – reactor Jul 19 '20 at 04:07
  • 1
    OK. Just fyi it's the officially recommended build system in the OCaml community now (including the ocamlbuild team: 'In recent years, the OCaml community has converged towards a more recent and faster build tool: Dune. If you are choosing a build system, you should probably use Dune instead. (Between January and June 2019, 77 new OCaml packages using ocamlbuild were publicly released, versus 544 packages using dune.)') – Yawar Jul 19 '20 at 15:40
  • thanks. I'll look at dune now. – reactor Jul 19 '20 at 20:09

1 Answers1

0

Without more details, it sounds like you have not added the "graphics" package to your _tag file. (Detailing this dependency is also required with dune).

octachron
  • 17,178
  • 2
  • 16
  • 23