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
embedding ocaml into a windows app: need gcc?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-09-27 (19:49)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] embedding ocaml into a windows app: need gcc?
On Sat, Sep 27, 2008 at 08:27:18PM +0100, Joel Reymont wrote:
> Can I do without gcc if I want to embed the OCaml compiler into a  
> commercial Windows app?

The OCaml compiler uses gcc in various stages (linking IIRC).  Also
needs an assembler.

> Do I need to become part of the OCaml consortium to do this?

You certainly need to read the license very carefully.

However is it necessary to embed the compiler?  Can you not just call
out to the compiler as a separate process?  It's surely easier to do
Sys.command, rather than working out the licensing and technical
issues involved in linking your program to the compiler.

> Ideally, I would like to generate OCaml code at runtime and compile it  
> into something that can be loaded by a runtime of some sort.
> Compiling into a DLL would be ideal, is it possible?

ocamlopt -fPIC ... should be able to do it.

Or compile the code with ocamlc and use Dynlink.

Or wait for OCaml 3.11 which can use Dynlink on native code.


Richard Jones
Red Hat