Ocaml的Graphics.open_graph不起作用

zel*_*ell 1 graphics ocaml

我试图按照ocaml手册绘制一些东西.但这是Ocaml的一个奇怪的回应.谁知道为什么?谢谢.

# #load "graphics.cma";;
# Graphics.open_graph "foo:0";;
_X11TransSocketINETConnect() can't get address for foo:6000: nodename nor servname provided, or not known
Exception: Graphics.Graphic_failure "Cannot open display foo:0".
Run Code Online (Sandbox Code Playgroud)

gas*_*che 5

我使用Graphics.open_graph " 600x400",它的工作原理.请注意分辨率规范之前的空格.

至于为什么foo:0会或不会工作,这不是OCaml特定的,而是关于X11服务器的.您可能不需要,因此不想使用此类专用功能(在另一个显示器上打开一个窗口).