Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] newbie - running graphics applications in WinNT
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Frank Atanassow <franka@c...>
Subject: Re: [Caml-list] newbie - running graphics applications in WinNT
Xavier Leroy wrote (on 17-10-01 21:12 +0200):
> > The "readme.win" file says that '"graph" works only under the toplevel
> > application'.  Does that mean I can't build an 'ocamlgraph' at all on
> > WinNT?
> 
> Yes.  Currently, the graphics library is not available from
> stand-alone Win32 executables, only from the toplevel GUI.
> 
> > I really want to use ocaml to create some standalone graphical
> > applications that can run on Win32 machines; is that possible?
> 
> Not yet, but it will be soon.  A proper standalone implementation of
> the Graphics library is in progress (by Jacob Navia) and should be
> available in the next OCaml release.

I recently built Ocaml 3.03 ALPHA under the latest Cygwin on Win2k, including
XFree86. The graphics library compiles without any problem, but if you
try to use it it, it will fail with an exception because graphics.ml does not
recognize Cygwin as a Unix-type system. This is easily fixed by patching
a definition in graphics.ml to read:

  let (open_graph, close_graph) =
    match Sys.os_type with
    | "Unix" | "Cywgin" -> (unix_open_graph, unix_close_graph)
    | ...

After that, I was able to create and use a graphics toplevel, and also to make
standalone (both bytecode and native) applications without any problems. Of
course, the graphics window shows up in the X server's window.

-- 
Frank Atanassow, Information & Computing Sciences, Utrecht University
Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands
Tel +31 (030) 253-3261 Fax +31 (030) 251-379
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr