caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] problem with -pack, native code, and PCRE
@ 2003-02-17  2:02 Eric C. Cooper
  2003-02-17 10:37 ` Xavier Leroy
  0 siblings, 1 reply; 3+ messages in thread
From: Eric C. Cooper @ 2003-02-17  2:02 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-02-17 20:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-17  2:02 [Caml-list] problem with -pack, native code, and PCRE Eric C. Cooper
2003-02-17 10:37 ` Xavier Leroy
2003-02-17 20:04   ` Eric C. Cooper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).