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 DAA18645; Mon, 17 Feb 2003 03:02:44 +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 DAA18644 for ; Mon, 17 Feb 2003 03:02:43 +0100 (MET) Received: from ux9.sp.cs.cmu.edu (UX9.SP.CS.CMU.EDU [128.2.220.166]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h1H22gP23185 for ; Mon, 17 Feb 2003 03:02:42 +0100 (MET) Received: from 12-227-100-158.client.attbi.com ([12.227.100.158]) by ux9.sp.cs.cmu.edu id aa30411; 16 Feb 2003 21:02 EST Received: from ecc by stratocaster.home with local (Exim 3.36 #1 (Debian)) id 18kac6-000885-00 for ; Sun, 16 Feb 2003 21:02:34 -0500 Date: Sun, 16 Feb 2003 21:02:34 -0500 To: caml-list@inria.fr Subject: [Caml-list] problem with -pack, native code, and PCRE Message-ID: <20030217020234.GA31174@stratocaster.home> Mail-Followup-To: caml-list@inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i From: "Eric C. Cooper" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk If I use "-pack" on a native-code module that uses Pcre, I get link errors when I try to use it. It works fine with bytecode. Suppose "a.ml" contains: let re = Pcre.regexp ".*" let str = "foo" and I do the following: % ocamlopt -I +pcre -c a.ml % ocamlopt -I +pcre -pack -o foo.cmx a.cmx Now suppose "test.ml" contains: let _ = print_endline Foo.A.str This command fails with lots of undefined references: % ocamlopt -I +pcre pcre.cmxa foo.cmx test.ml /usr/lib/ocaml/3.06/pcre/pcre.a(pcre.o)(.text+0x3a42): In function `Pcre__substitute_477': : undefined reference to `caml_tuplify2' /usr/lib/ocaml/3.06/pcre/pcre.a(pcre.o)(.text+0x4212): In function `Pcre__substitute_first_587': : undefined reference to `caml_tuplify2' /usr/lib/ocaml/3.06/pcre/pcre.a(pcre.o)(.data+0x10c): In function `Pcre__3': : undefined reference to `caml_curry7' [... many more omitted ...] If I use ocamlc and .cmo/.cma files, it works fine. Any help or workarounds would be appreciated. -- Eric C. Cooper e c c @ c m u . e d u ------------------- 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