ocamlbuild can't find file graphics.cma

229 Views Asked by At

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.

1

There are 1 best solutions below

0
octachron On

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).