Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Ken Wakita <wakita@i...>
Subject: RE: linking ocaml in multithreaded shared dll app

In message (<000001c04a50$fbed35c0$b2328aa4@wfr01946>)
from "Lionel Fourquaux" <lionel.fourquaux@wanadoo.fr>,
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