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
ocamlfind syntax problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pietro Abate <Pietro.Abate@a...>
Subject: ocamlfind syntax problem
Hi all,

I'm trying to learn how to use ocamlfind with camlp4 syntax files.

The problem is that my syntax file uses extlib and I get an undefined
reference to ExtLib when I try to compile everything with ocamlfind.

Since now I've compiled it following these steps:

1) I generate the ocaml code from my example using my syntax (with str
and extlib)
# camlp4o $STDLIB/str.cma $DESTDIR/extlib/extLib.cma syntaxfile.cma pr_o.cmo >
2) I compile the result using other packages and ocamlfind.
# ocamlfind ocamlc -package mypackages

now I'm trying to skip the intermediate step. Therefore I've created 
my meta file that looks like this:

version = "0.1"
description = "syn file"
requires = "camlp4 extlib"
archive(syntax,preprocessor) = "syntaxfile.cma"

and I'm trying to link everything together with:
#ocamlfind ocamlc -package mypackages,syntaxfile -syntax syntaxfile

but it complains that syntaxfile.cma has a Reference to undefined global `ExtLib'.

adding extlib to mypackages doesn't help... 
how can I pass $STDLIB/str.cma $DESTDIR/extlib/extLib.cma to the preprocessor 
via ocamlfind ?


ps: my compilation infrastructure is more complex, but I think the
problem boils down to what I've described above.

++ Blog:
++ "All great truths begin as blasphemies." -George Bernard Shaw
++ Please avoid sending me Word or PowerPoint attachments.