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 SAA14030; Fri, 18 Jul 2003 18:21:08 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 SAA10878 for ; Fri, 18 Jul 2003 18:20:51 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h6IGIpf04610; Fri, 18 Jul 2003 18:18:51 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA09615; Fri, 18 Jul 2003 18:18:35 +0200 (MET DST) Date: Fri, 18 Jul 2003 18:18:35 +0200 From: Xavier Leroy To: Dmitry Bely Cc: caml-list@inria.fr Subject: Re: [Caml-list] ocamlmklib on Windows Message-ID: <20030718181835.A31913@pauillac.inria.fr> References: <20030716150704.GA17252@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from dbely@mail.ru on Fri, Jul 18, 2003 at 07:26:47PM +0400 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 libs:01 hackery:01 linked:01 compiler:01 lib:01 ocamlmklib:01 linking:02 external:03 dll:03 obj:03 library:03 dynamic:03 object:03 let:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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