我在caml中的一个小函数有问题。这是我的功能:
let show img =
let h = height img in
let w = width img in
open_graph (" "^string_of_int w^"x"^string_of_int h);
set_window_title "Seam Carving";
draw img;
if Graphics.key_pressed() then
match Graphics.read_key() with
| 'q' -> close_graph()
| _ -> ()
;;
当我单击按钮"q"时,出现此错误: Fatal error: exception Graphics.Graphic_failure("Xlib error: BadPixmap (invalid Pixmap parameter)")
或分段错误。
有人可以向我解释这种错误的原因吗?谢谢:)
您的问题不会得到答复,因为其中没有足够的信息。
通常,如果您在使用 OCaml 时遇到分段错误,这是一个主要错误,因此您应该在 OCaml 错误跟踪器上填写错误报告,并上传重现错误的程序。