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 LAA22838; Thu, 1 Apr 2004 11:15:55 +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 LAA21411 for ; Thu, 1 Apr 2004 11:15:54 +0200 (MET DST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i319FpYM018904 for ; Thu, 1 Apr 2004 11:15:52 +0200 Received: from [192.168.1.200] (ppp113-158.lns1.syd3.internode.on.net [150.101.113.158]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i319FmUK090375; Thu, 1 Apr 2004 18:45:49 +0930 (CST) Subject: Re: [Caml-list] Re: Ocamlgraph build error From: skaller Reply-To: skaller@users.sourceforge.net To: skaller@users.sourceforge.net Cc: caml-list@pauillac.inria.fr In-Reply-To: <1080770580.13854.126.camel@pelican> References: <1080770580.13854.126.camel@pelican> Content-Type: text/plain Message-Id: <1080810947.13854.268.camel@pelican> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 01 Apr 2004 19:15:48 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 sourceforge:01 patched:01 elt:01 struct:01 hash:01 hashtbl:01 hash:01 elt:01 endline:01 endline:01 pelican:01 ocamlc:01 pelican:01 ocamlopt:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 11 [Patched Ocamlgraph so it works on 32 bit machine] ------------------- module Elt = struct type t = int let compare = compare let hash = Hashtbl.hash let equal = (=) end ;; module MyGraph = Graph.Imperative.Digraph.Concrete(Elt) ;; let check() = let g = MyGraph.create () in MyGraph.add_vertex g 1; MyGraph.add_vertex g 2; MyGraph.add_vertex g 3; MyGraph.add_vertex g 4; MyGraph.add_vertex g 5; MyGraph.add_edge g 1 2; MyGraph.add_edge g 2 3; print_endline "Graph constructed" ;; print_endline "Try using graph module";; check();; --------------------- This works fine as per instructions: [skaller@pelican] ~>ocamlc graph.cmo gr.ml -o gr [skaller@pelican] ~>./gr Try using graph module Graph constructed ------------------------------ But this doesn't: [skaller@pelican] ~>ocamlopt graph.cmx gr.ml -o gr /tmp/camlstartup43f4c5.o(.text+0xe5): In function `caml_program': : undefined reference to `camlGraph__Sig__entry' /tmp/camlstartup43f4c5.o(.text+0xf1): In function `caml_program': : undefined reference to `camlGraph__Sig_pack__entry' /tmp/camlstartup43f4c5.o(.text+0xfd): In function `caml_program': ..... collect2: ld returned 1 exit status Error during linking ------------------------------ Instructions are: ----------------------- ocamlgraph is packaged as a single module `Graph'. Link is done as follows: - bytecode ocamlc graph.cmo - native code ocamlopt graph.cmx -------------------- I must be doing something basic wrong .. using CVS ocaml: Objective Caml version 3.07+13 (2004-01-04) -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- 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