没有控制台,如何在Windows下创建或编译GUI应用程序?我已经在网上搜索过了,但是我没有发现任何有用的东西。如果你能提供任何指导,我将不胜感激。
(* ocamlc -I +labltk labltk.cma gui.ml -o gui.exe *)
open Tk ;;
let top = openTk () ;;
Wm.title_set top "Application 1" ;;
Wm.geometry_set top "200x500";;
let blue = Button.create ~text:"Blue" top ;;
let red = Button.create ~text:"Red" top ;;
pack [blue ; red];;
let mylist = Listbox.create ~selectmode:`Multiple top
let _ = Listbox.insert
~index:`End
~texts:["Mozart";"Chopin";"Beethoven";"Verdi";"Bizet"]
mylist ;;
pack [mylist];;
let _ = Printexc.print mainLoop ();;发布于 2013-09-21 15:39:32
您需要将‘-子系统窗口’传递给链接器;也可能是‘-定制’,因为ocamlrun.exe是一个控制台应用程序:
ocamlc -I +labltk labltk.cma gui.ml -custom -cclib -subsystem -cclib windows -o gui.exehttps://stackoverflow.com/questions/18932835
复制相似问题