From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA07446 for caml-red; Fri, 15 Dec 2000 13:49:26 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA23613 for ; Thu, 14 Dec 2000 19:51:48 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id eBEIpgL24706; Thu, 14 Dec 2000 19:51:42 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA30689; Thu, 14 Dec 2000 19:51:38 +0100 (MET) Date: Thu, 14 Dec 2000 19:51:38 +0100 From: Xavier Leroy To: Charles Neveu Cc: caml-list@inria.fr Subject: Re: linking ocaml in multithreaded shared dll app Message-ID: <20001214195138.A25832@pauillac.inria.fr> References: <000001c04a50$fbed35c0$b2328aa4@wfr01946> <3A384431.7B553F0C@artemis.arc.nasa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <3A384431.7B553F0C@artemis.arc.nasa.gov>; from neveu@artemis.arc.nasa.gov on Wed, Dec 13, 2000 at 07:53:21PM -0800 Sender: weis@pauillac.inria.fr > 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 own. 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