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 KAA30936; Tue, 29 Jul 2003 10:48:00 +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 KAA11502 for ; Tue, 29 Jul 2003 10:47:59 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h6T8luf13676 for ; Tue, 29 Jul 2003 10:47:57 +0200 (MET DST) Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3p2/3.7W) with ESMTP id RAA21421; Tue, 29 Jul 2003 17:47:51 +0900 (JST) To: rich@annexia.org Cc: caml-list@inria.fr Subject: Re: [Caml-list] Dynlink problems In-Reply-To: <20030728174154.GA19639@redhat.com> References: <20030728094918.GA19609@redhat.com> <005201c354f2$1f2df430$ca00a8c0@warp> <20030728174154.GA19639@redhat.com> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030729174830D.garrigue@kurims.kyoto-u.ac.jp> Date: Tue, 29 Jul 2003 17:48:30 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; jacques:01 caml-list:01 dynlink:01 httpd:01 stdlib:01 val:01 composing:01 dynamically:01 linked:01 unsafe:01 caml:01 garrigue:01 interfaces:01 syntax:02 linking:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Richard Jones > So far I get strange errors like: > > Syntax error on line 84 of /home/rich/d/merjis/test/mod_caml/test/httpd.conf: > error while linking /home/rich/d/merjis/test/mod_caml/eg_print_trans.cma. > Reference to undefined global `Callback' > > I can fix that one by added stdlib.cma to the list of libraries linked > into eg_print_trans.cma, but that seems the wrong thing to do. Indeed, this is not the best way to do that. What you should is export the corresponding units to dynlink modules. From the documentation: val add_interfaces : string list -> string list -> unit (** [add_interfaces units path] grants dynamically-linked object files access to the compilation units named in list [units]. The interfaces ([.cmi] files) for these units are searched in [path] (a list of directory names). Initially, dynamically-linked object files do not have access to any of the compilation units composing the running program, not even the standard library. [add_interfaces] or {!Dynlink.add_available_units} (see below) must be called to grant access to some of the units. *) Actually [add_available_units] is probably better. > Even when I do this, I get: > > Syntax error on line 84 of /home/rich/d/merjis/test/mod_caml/test/httpd.conf: > error while linking /home/rich/d/merjis/test/mod_caml/eg_print_trans.cma. > The external function `caml_input' is not available > > .. which I haven't been able to fix because -lcamlrun is only available > as a static library (why??). If you dynamically link modules with external definitions, you must also call [allow_unsafe_modules]! Jacques Garrigue ------------------- 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