From: Sylvain LE GALL <sylvain.le-gall@polytechnique.org>
To: Attila Kondacs <attila@zurich.ai.mit.edu>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] native-code and byte-code compiler differences
Date: Sun, 31 Mar 2002 21:09:54 +0200 [thread overview]
Message-ID: <20020331190954.GA19755@gallu.polytechnique.fr> (raw)
In-Reply-To: <Pine.LNX.4.21.0203291538590.19082-100000@neuchatel.ai.mit.edu>
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
next prev parent reply other threads:[~2002-04-01 21:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-29 21:00 Attila Kondacs
2002-03-31 18:59 ` Michel Quercia
2002-03-31 19:09 ` Sylvain LE GALL [this message]
2002-03-31 19:32 ` Tim Freeman
2002-04-02 17:14 ` Andrej Bauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020331190954.GA19755@gallu.polytechnique.fr \
--to=sylvain.le-gall@polytechnique.org \
--cc=attila@zurich.ai.mit.edu \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).