Discussion:
OCaml Problem: Can't access Str module
(too old to reply)
C Rose
2003-12-01 00:23:17 UTC
Permalink
Hi all

I wonder if anyone can help:

I am trying to use the Str module to use regular expressions, but when
I try to use it, I am told "Reference to undefined global `Str'".

Example usage:

let my_reg_exp =
Str.regexp "[A-Z]";;

I am using OCaml 3.06 on the OS X platform.

If anyone can point out what I'm doing wrong, I'd be grateful of your
advice.

Thanks

Chris
Neelakantan Krishnaswami
2003-12-01 01:38:31 UTC
Permalink
Post by C Rose
I am trying to use the Str module to use regular expressions, but
when I try to use it, I am told "Reference to undefined global
`Str'". If anyone can point out what I'm doing wrong, I'd be
grateful of your advice.
To use it in the interactive interpreter, issue a #load "str.cma";;
command first. To link it into a program, do:

ocamlc other options str.cma other files
ocamlopt other options str.cmxa other files

This is from the documentation at:

<http://caml.inria.fr/ocaml/htmlman/manual037.html>
--
Neel Krishnaswami
***@cs.cmu.edu
C Rose
2003-12-15 17:54:20 UTC
Permalink
Thanks for your help.

Loading...