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
ocamlbuild single quotes causing trouble
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-06-22 (14:53)
From: Andrew Warshaver <awarshaver@j...>
Subject: ocamlbuild single quotes causing trouble
Hi all,

I was trying to compile a project using ocamlbuild with an external 
library located distantly, so I did the following (I am also doing 
preprocessing on the file):

ocamlbuild -libs pcre -cflags -I,~/multi-oc/lib -pp "camlp4o 
~/multi-oc\/lib/pa_type_conv.cmo ~/multi-oc/lib/pa_sexp_conv.cmo" 

Then ocamlbuild eventually runs the following command:

/usr/local/home/godi310/godi/bin/ocamlc.opt -c -I '~/multi-oc/lib' -pp 
'camlp4o ~/multi-oc/lib/pa_type_conv.cmo 
~/multi-oc/lib/pa_sexp_conv.cmo' -o id.cmi id.mli

and spits the error:

File "id.mli", line 1, characters 0-9:
Unbound module Jane
Command exited with code 2.

I noticed, however, if I remove the single quotes from the command -- 
like this --

/usr/local/home/godi310/godi/bin/ocamlc.opt -c -I ~/multi-oc/lib -pp 
'camlp4o ~/multi-oc/lib/pa_type_conv.cmo 
~/multi-oc/lib/pa_sexp_conv.cmo' -o id.cmi id.mli

it works just fine.  I also discovered that if I don't use the ~ abbrev. 
then everything is happy (although this took me a long time to 
discover!).  Is this a problem with ocamlbuild, or something deeper, or 
perhaps even expected behaviour?