ocaml / graphics

The Graphics library from OCaml, in a standalone repository
Other
56 stars 29 forks source link

Does this library work for the Windows Linux Subsystem? #21

Closed awang9999 closed 4 years ago

awang9999 commented 4 years ago

I successfully installed graphics and tried to run open_graph "" and obtained the following error: Graphic_failure "Cannot open display ".

I'm running OCaml and Opam in the windows Linux subsystem.

nojb commented 4 years ago

OCaml (and OPAM) installed in WSL works pretty much as on any other Unix distribution. In particular, you will probably need to install an X server in order to work with GUI programs.

awang9999 commented 4 years ago

Yep, that did the trick. My default window is now just appearing and instantly disappearing. Any insights on that? Sorry, if this no longer pertains to the issue I initially raised.

nojb commented 4 years ago

Yep, that did the trick. My default window is now just appearing and instantly disappearing. Any insights on that? Sorry, if this no longer pertains to the issue I initially raised.

Are you doing anything after creating the Graphics window? If not, the program will terminate right away and take down the window with it.

For example, you can call Graphics.read_key to block until a key is pressed.

awang9999 commented 4 years ago

Understood. Thank you so much for the rapid and helpful response!