本文介绍了Ocaml的Graphics.open_graph不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图按照进行绘制一些东西。但是这是Ocaml顶层的一个奇怪的回应。任何人看到为什么谢谢。
我使用 Graphics.open_graph 600x400,它的工作原理。注意分辨率规格之前的空格。
至于为什么 foo:0 不会起作用,那就是不是OCaml专用的,而是关于X11服务器的。您可能不需要,因此也不想使用这种专用功能(在另一个显示器上打开窗口)。
I am trying to follow the ocaml manual to draw something. But here is a strange response from Ocaml's toplevel. Anyone sees why? Thanks.
# #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".解决方案I use Graphics.open_graph " 600x400", and it works. Note the space before the resolution specification.
As to why foo:0 would or would not work, that is not OCaml-specific but something about the X11 server. You probably don't need to, and therefore don't want to, use such specialized feature (opening a window on another display).
这篇关于Ocaml的Graphics.open_graph不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!