English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
exception not registered.Abandon
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-03-13 (18:55)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] exception not registered.Abandon
On Sat, Mar 13, 2010 at 07:36:16PM +0100, Florent Monnier wrote:
> > > I have compiled a program using the native compiler, then when I run the
> > > executable I get this error message:
> > >
> > > exception not registered.Abandon
> > >
> > > Searching Google I don't find anything about this error message.
> > > How should I interpret it?
> > 
> > Is the program linked to C code (apart from stdlib, I mean)?
> Yes it is.
> It's linked with OpenGL (only the GL lib, no GLU or anything esle) and SDL 
> (through ocaml-sdl)
> It's a program that I try to switch the windowing part from Glut to SDL.
> With Glut it works alright.
> Also I've just seen that running in the interpreted mode instead of native 
> code the program does run without any problem.
> Do these additional informations give you any clue?

As Adrian said, it's from ocaml-SDL.  It's from one of several
functions which look like this:

 static void
 sdlloader_raise_exception (char *msg)
   static value *loader_exn = NULL;
   if(! loader_exn){
     loader_exn = caml_named_value("SDLloader_exception");
     if(! loader_exn) {
       fprintf(stderr, "exception not registered.");
   raise_with_string(*loader_exn, msg);

Essentially you have to register OCaml exceptions before you can call
them from C, so it sounds like you're not calling some sort of SDL
"init" function (or calling it too late in your program).  Or possibly
there is a bug in the ocaml-SDL bindings.


Richard Jones
Red Hat