0
我在caml中有一個小函數的問題。 這裏我的功能:Ocaml:異常Graphics.Graphic_failure(「Xlib錯誤:BadPixmap(無效的Pixmap參數)」)
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)")
或段故障。
有人能解釋一下這種錯誤的原因嗎?謝謝:)
您的代碼不起作用。 – didierc
'q'按鈕是什麼? – didierc
你應該嘗試提供一個最小化的可編譯程序來暴露你想要得到解釋的問題。 – didierc