Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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
Hat.

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


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