Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] How to use pcre
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-09-06 (19:53)
From: Johann Spies <jhspies@a...>
Subject: Re: [Caml-list] How to use pcre (3)
Markus Mottl <> writes:

> This is an FAQ and not related to the Pcre in particular: the problem
> is that

Maybe a FAQ, but difficult for newbies to know when and how.  

>   a) you have to build a "customized" toplevel, because a C-library
>      has to be linked in. This is very easy:

After a bit of experimentation I got this to work.

After about another hour and a half I did not succeed in compiling the
following program:

let s = "abcde";;
let t = Pcre.replace ~pat:"c" ~templ:" Hier gebeur 'n ding " s;;
print_string t;;

I have read the man page for ocamlopt as well as the ocaml manual and
still do not know how to compile it!?  Maybe I am just dumb.

My latest effort was:

$ocamlfind ocamlopt -o rex -I /usr/lib/ocaml/contrib -ccopt
-L/usr/lib/ocaml/contrib  -cclib -llibpcre.a -linkall /tmp/

No implementations provided for the following modules:
  Pcre referenced from /tmp/rex.cmx

The usage of ocamlfind made no difference.

J.H. Spies - Tel. 082 782 0336 / 021-808 4036(w)  
             Posbus 4668, Tygervallei 7536
     "Behold, I stand at the door, and knock; if any man 
      hear my voice, and open the door, I will come in to 
      him, and will sup with him, and he with me."       
                                   Revelation 3:20 
Bug reports:  FAQ:
To unsubscribe, mail  Archives: