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 TAA17840 for caml-red; Fri, 10 Nov 2000 19:34:47 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA32179 for ; Fri, 10 Nov 2000 03:37:02 +0100 (MET) Received: from mail.is.titech.ac.jp (mail.is.titech.ac.jp [131.112.51.131]) by nez-perce.inria.fr (8.11.1/8.10.0) with SMTP id eAA2b0H10740 for ; Fri, 10 Nov 2000 03:37:01 +0100 (MET) Received: (qmail 13157 invoked from network); 10 Nov 2000 02:36:59 -0000 Received: from dmznat-9.is.titech.ac.jp (HELO localhost) (131.112.51.189) by mail.is.titech.ac.jp with SMTP; 10 Nov 2000 02:36:59 -0000 To: lionel.fourquaux@wanadoo.fr Cc: neveu@artemis.arc.nasa.gov, caml-list@inria.fr Subject: RE: linking ocaml in multithreaded shared dll app In-Reply-To: <000001c04a50$fbed35c0$b2328aa4@wfr01946> References: <3A0855AC.77F9C627@artemis.arc.nasa.gov> <000001c04a50$fbed35c0$b2328aa4@wfr01946> X-Mailer: Mew version 1.94.1 on Emacs 20.5 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20001110113717D.wakita@is.titech.ac.jp> Date: Fri, 10 Nov 2000 11:37:17 +0900 From: Ken Wakita X-Dispatcher: imput version 990905(IM130) Sender: weis@pauillac.inria.fr In message (<000001c04a50$fbed35c0$b2328aa4@wfr01946>) from "Lionel Fourquaux" , talking about "RE: linking ocaml in multithreaded shared dll app", on Thu, 9 Nov 2000 14:28:41 +0100 > > -----Message d'origine----- > > De : Pierre.Weis@inria.fr [mailto:Pierre.Weis@inria.fr]De la part de > > Charles Neveu > > Envoye : mardi 7 novembre 2000 20:19 > > A : caml-list@inria.fr > > Objet : linking ocaml in multithreaded shared dll app > > > > > > I'm trying to link the ocaml library into a Windows NT 4.0, > > MS VC++ 6.0 > > application that uses MFC in a shared dll (because another library, > > OpenInventor, has to be linked this way). > > I'm getting an unresolved external symbol error for the symbols > > __pctype, ___mb_cur_max, and __dosmaperr from files like win32.obj, > > read.obj, write.obj, etc. (complete text at bottom). > > That's because you're linking with msvcrt.dll (DLL version of > Microsoft's C runtime). OCaml is linked with libcmt.lib (static > multithreaded > version of the same). A while ago when Cygwin patch for ocaml was announced in this list, I tried to use it with the Mingw framework. Mingw is a version of gcc targeted for MFC environment. It allows production of executable that does not depend on Cygwin but on msvcrt.dll. This way we can distribute executable O'Caml binary executables to those who are not using Cygwin. I also tried compiling the GTk on Mingw and make lablgtk package and execute a small lablgtk application. > > I'm not a MSVC++ expert, but I'm guessing that the libunix library is > > compiled to be linked with a statically-linked MFC library. Is this > > right? Is there anyway to compile it to link to a > > dynamically-linked MFC > > library? > > Not exactly. OCaml doesn't use MFC. The problem is with the C library. > Moreover, you can't build the libunix library for linking with msvcrt.dll, > because it uses the internal function _dosmaperr, which is not exported by > the DLL. Mingw lacks many of the unix interface provided by the Cynwin. I think we need much porting effort to get most of the Unix and Threads package to work. Ken Wakita