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 UAA18125; Thu, 14 Nov 2002 20:14:15 +0100 (MET) 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 UAA18114 for ; Thu, 14 Nov 2002 20:14:12 +0100 (MET) Received: from relay-3m.club-internet.fr (relay-3m.club-internet.fr [194.158.104.42]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id gAEJEB109338; Thu, 14 Nov 2002 20:14:11 +0100 (MET) Received: from warp (lns06a-6-217.w.club-internet.fr [212.194.125.217]) by relay-3m.club-internet.fr (Postfix) with SMTP id 2A527E0F4; Thu, 14 Nov 2002 20:14:19 +0100 (CET) Message-ID: <009301c28c12$4dcee5a0$3c00a8c0@warp> From: "Nicolas Cannasse" To: "Xavier Leroy" , "Chris Hecker" Cc: References: <4.3.2.7.2.20021113221318.03f89028@localhost> <20021114160348.B9597@pauillac.inria.fr> Subject: Re: [Caml-list] ocamlc linking loads dlls? Date: Thu, 14 Nov 2002 20:16:15 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > Why does ocamlc load dlls during linking? > > Just to make sure that all external C functions referenced from your > Caml code are indeed defined in the DLLs you provide. Otherwise, the > error would only be detected at run time, and earlier is better. > > > a) dlls that aren't in the path during build, and > > b) dlls that do complex stuff in their dllmain. > > I agree b) is a bit of a problem, but I don't know of any portable way > to test whether DLL x.dll defines symbol "foo" than to link x.dll and > query the address of "foo". That point can be resolved by calling LoadLibraryEx with the DONT_RESOLVE_DLL_REFERENCE flag. According to MS docs, this prevent the call of DllMain. Nicolas Cannasse ------------------- 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