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
linking ocaml in multithreaded shared dll app
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-12-15 (12:49)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: linking ocaml in multithreaded shared dll app
> So, is it possible to build the ocaml library multithreaded-DLL?

As Lionel Fourquaux said, it should be possible: just replace /MT by
/MD in the source file config/Makefile.nt and rebuild the whole system.

However, there is an issue with the Unix library, which uses an
undocumented C library function _dosmaperr() to convert from Win32
error codes to Unix-style error codes.  This function is not exported
by the DLL version of the MSVC C library.  Yes, it's a stupid mistake
of mine to rely on this function, and I should have reimplemented my

What Lionel suggests is to get the source code for _dosmaperr() from
the MSVC C library sources, recompile it and add it to your code.
Ponder legal issues before doing this, though.

> If not, where do I find DOSMAP.C? I've searched my CD's, harddrive and
> the net...

The MSVC CD should contain (or used to contain) a ZIP file with the
sources for the C run-time library (look for files or directories
called CRT or something like it).  The source code for _dosmaperr() is
somewhere in there.

Good luck,

- Xavier Leroy