From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA18610; Mon, 1 Apr 2002 23:03:47 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA19559 for caml-list@pauillac.inria.fr; Mon, 1 Apr 2002 23:03:46 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA00510 for ; Sun, 31 Mar 2002 21:07:38 +0200 (MET DST) Received: from x-mailer.polytechnique.fr (x-mailer.polytechnique.fr [129.104.35.1]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g2VJ7bD17597 for ; Sun, 31 Mar 2002 21:07:37 +0200 (MET DST) Received: from gallu (mail@[129.104.205.147]) by x-mailer.polytechnique.fr (x.y.z/x.y.z) with ESMTP id VAA08266; Sun, 31 Mar 2002 21:06:55 +0200 (MET DST) Received: from gildor by gallu with local (Exim 3.35 #1 (Debian)) id 16rkiB-0005Ck-00; Sun, 31 Mar 2002 21:09:55 +0200 Date: Sun, 31 Mar 2002 21:09:54 +0200 To: Attila Kondacs Cc: caml-list@inria.fr Subject: Re: [Caml-list] native-code and byte-code compiler differences Message-ID: <20020331190954.GA19755@gallu.polytechnique.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i From: Sylvain LE GALL Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, Mar 29, 2002 at 04:00:41PM -0500, Attila Kondacs wrote: > the following is a code segment that opens a window and if 'q' is > pressed on the keyboard it closes it. It works with the byte code > compiler fine but does not react to pressed keys when compiled with the > native code compiler (using ocaml 3.04 for debian - from the unstable > distribution). > > According to the ocaml manual this may happen if there is devision by 0 > caught as an exception, or stack overflow, or if signal handling is > involved. The first two cases are out of question here, and as far as I > know reading mouse and keyboard events do not involve signals. So what's > wrong here? and how can it be put right? > Your code is good and work perfectly but as you say : According to the ocaml manual ... Unix: This library is implemented under the X11 windows system. Programs that use the graphics library must be linked as follows: ocamlc other options graphics.cma other files For interactive use of the graphics library, do: ocamlmktop -o mytop graphics.cma ./mytop or (if dynamic linking of C libraries is supported on your platform), start ocaml and type #load "graphics.cma";;. In other word no command specified for ocamlopt. So it seems to not works properly with native compiler. As far as my exprience, graphics is a pretty good library but as many restriction. If you want other fault ( and it is with the bytecode ). Try open_graphic... Unix.socket... Unix.select. For me the code crash and give me an exception explaining an unknow error raised ( but it works with no graphics opened ). If i were you i try labltk or lablgtk... ( longer to code but more close to system abstraction ) Sylvain LE GALL ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners