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
[Caml-list] cygwin/mingw linking
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-09-17 (08:05)
From: Dmitry Bely <dbely@m...>
Subject: Re: [Caml-list] cygwin/mingw linking
CaptnJamesKirk@aol.com writes:

> I've got OCaml 3.02 succesfully installed, compiled, and working under 
> Windows ME using the latest cygwin. I would like to be able to link my 
> programs using mingw so the executable doesn't need cygwin1.dll. The docs 
> mention using the -output-obj option to create an *.o object file that can be 
> linked, but the manual talks about wrapping this with a C program, etc., 
> which is not what I want. I just want to manually link the object file(s) 
> with whichever libraries are needed, using a separate mingw installation.

You cannot do this directly because Ocaml runtime and all its libraries are
also linked with cygwin1.dll if you use cygwin port.

> Can I do this?

It requires some work, but of course is possible. Some time ago I
experimented with combined cygwin/mingw port of Ocaml 3.01:

1. All development tools and byte-compiled ocaml executables are
cygwin-based (linked with cywin1.dll). You have all advantages of standard
cygwin build -- working debugger, profiler etc.

2. At the same time ocamlopt compiler (being the cygwin binary itself)
produces fully native Win32 code, using only standard MSVC runtime
(msvcrt.dll) -- just as "gcc -mno-cygwin" (i.e. mingw) does. If works much
faster (no UNIX emulation layer required) and allows to create commercial
applications without very expensive cygwin1.dll commercial license from Red

Unfortunately, OCaml team thinks that supporting even two existing Win32 ports
(MSVC & cygwin) is too boring. So all this is unlikely to be included into
the distribution ...

Hope to hear from you soon,

Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr