From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id AAA17889; Sat, 19 Jul 2003 00:39:38 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 AAA27958 for ; Sat, 19 Jul 2003 00:39:36 +0200 (MET DST) Received: from crufty.research.bell-labs.com (ns2.research.bell-labs.com [204.178.16.49]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h6IMdZT20951; Sat, 19 Jul 2003 00:39:35 +0200 (MET DST) Received: from grubby.research.bell-labs.com (H-135-104-2-9.research.bell-labs.com [135.104.2.9]) by crufty.research.bell-labs.com (8.12.9/8.12.9) with ESMTP id h6IMdY9Y028195; Fri, 18 Jul 2003 18:39:34 -0400 (EDT) Received: from starling.research.bell-labs.com (starling.research.bell-labs.com [135.104.26.187]) by grubby.research.bell-labs.com (8.12.9/8.12.9) with ESMTP id h6IMdQ4e070599; Fri, 18 Jul 2003 18:39:26 -0400 (EDT) Received: from dhcp50117.cs.bell-labs.com (dhcp50117.cs.bell-labs.com [135.104.50.117]) by starling.research.bell-labs.com (8.12.9/8.12.9) with ESMTP id h6IMdkGV029578; Fri, 18 Jul 2003 18:39:46 -0400 (EDT) Subject: Re: [Caml-list] ocamlmklib on Windows From: Jerome Simeon To: Xavier Leroy Cc: Dmitry Bely , caml-list@inria.fr In-Reply-To: <20030718181835.A31913@pauillac.inria.fr> References: <20030716150704.GA17252@redhat.com> <20030718181835.A31913@pauillac.inria.fr> Content-Type: text/plain Message-Id: <1058571633.27312.162.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 18 Jul 2003 19:40:44 -0400 Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; jerome:01 simeon:01 caml-list:01 galax:01 api:01 flags:01 mingw:01 runtime:01 nativecode:01 libs:01 hackery:01 bug:01 faq:01 beginner's:01 beginners:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I would be interested to follow the discussion. DLL/Dynamic linking is currently one of the main problem we have in Galax. Our (surprisingly ambitious) goal was to to wrap Caml code transparently behind a C/C++/Java API. The Java part requires dynamic linking. Here were our results so far: (1) Things worked ok on Linux and on most other Unix-gcc based systems we tried, although finding the right compiler flags was sometime tricky (why on earth is the '-mimpure-text' needed under Solaris?). (2) It took us more than two weeks to get some dynamic linking going with the MinGW port of Caml, and it only worked so far with the bytecode runtime. I'm still trying to figure out what goes wrong for the nativecode. I was starting to think we should try with the VC++ port, but the current discussion seems to indicate its another big mess. (3) Dynamic linking does not work under MacOS X. Any chance of things improving in the near future? My dream would be some kind of compilation magic to wrap Caml inside a C dynamic library, but improvements on (2) and (3) above would already be a big help. Thanks, - Jerome Simeon On Fri, 2003-07-18 at 12:18, Xavier Leroy wrote: > > That don't seems to be correct. Dynamic and static libs can be linked > > with any Win32 compiler from the same set of object files. To illustrate > > this, just let me quote myself > > At least with the version of VC++ I use, your example stops working > when you put the .obj files *in a static library* (which is the point > of the exercise): > > cl -c -MD lib.c > # static linking > cl -MD main.c lib.obj > # LINK : warning LNK4049: locally defined symbol "_x" imported > # but main.exe still works (the warhing can be supressed) > # static linking via a static lib > lib /out:staticlib.lib lib.obj > cl -MD main.c staticlib.lib > # main.obj : error LNK2001: unresolved external symbol __imp__x > # main.exe : fatal error LNK1120: 1 unresolved externals > > If you know how to work around this, that'd be great. I'd suggest we > take this discussion off caml-list, though, as DLL hackery is getting > out of topic. > > - Xavier Leroy > > ------------------- > To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners -- Jerome Simeon ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners