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
ocamlopt and *using* DLLs
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-05-27 (01:49)
From: Robert Roessler <roessler@r...>
Subject: Re: [Caml-list] ocamlopt and *using* DLLs
Nicolas Cannasse wrote:

>>Put a different way, ml_scintilla.dll definitely has a dependence on
>>ocamlrun.dll - which logical need would not go away even if I
>>repackaged the DLL as a static lib.
> Actually the symbols are only imported from ocamlrun.dll if you compile-with
> or define the CAML_DLL preprocessor variable.
> If you don't have CAML_DLL defined, symbols will be resolved at linking
> time, and will then be found in your executable.
> So it's possible to have a staticly linked library in both bytecode
> (with -custom) and nativecode.

The proper use of CAML_DLL, along with your exposition on the
differences between the bytecode and native runtime models was key to
making this all work for me... but it is now.

> You can have a look at the OCaml Win32 API library Makefile that have
> different ways of building and linking it
> (http://ocaml-win32.sourceforge.net/).

This is actually funny - about a year and a half ago, when I was first
looking at OCaml, I corresponded with Harry Chomsky and pointed out a
bug in the makefile being distributed with this project - having to do
with [not] defining CAML_DLL! :)

I also contributed a small amount of code to the project, but ended up
not being able to use the "OCaml Win32 API" because of the license. :(

Robert Roessler