Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] "Error while building custom runtime system"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Initialization order bug
Olivier Andrieu provided the right answer to this:

> This sort of things happen when :
>  - you have lots of externals in your module (here Perl)
>  - the module runs some initialization-time code that doesn't appear
>    in the interface
>  - the only values referenced by other values are externals
> 
> then the module is in fact not linked in : it's not needed because the
> other modules directly call the external functions. The problem is
> that often these externals do not work without the proper
> initialization.
> 
> Some workarounds are to :
>  - make the initialization code appear in the .mli, through a init
>    function for instance
>  - use `val' instead of `external' in the .mli
>  - use -linkall when linking the program

It works now, but I still think this is a bug.

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - all your business data are belong to you.
MONOLITH is an advanced framework for writing web applications in C, easier
than using Perl & Java, much faster and smaller, reusable widget-based arch,
database-backed, discussion, chat, calendaring:
http://www.annexia.org/freeware/monolith/

-------------------
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