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
nonresolved .cma files and errors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-04-11 (06:58)
From: Martin Jambon <martin.jambon@e...>
Subject: Re: [Caml-list] nonresolved .cma files and errors
On Tue, 10 Apr 2007, Jeff Henrikson wrote:

> Hello caml-list,
> I recently had a shocking realization about why some of my experiments with 
> camlp4 weren't compiling.  I had been linking camlp4.cma, which was the old 
> name of the library.  Now camlp4.cma doesn't exist and there are multiple 
> flavors Camlp4xxx.cma where the xxx is the same flavor notation of the the 
> preprocessor binaries.  So the trouble is, why was linking such a library not 
> a fatal?  Apparently all missing .cma and .cmo files passed on the command 
> line are considered non-errors.  It seems intutive to me that both should be 
> fatals!
> ~/src/camlp4-beta jehenrik$ ocamlc -I +camlp4 -pp camlp4orf junk.cma 
> camlp4orf.cma -c
> ~/src/camlp4-beta jehenrik$ ocamlc -I +camlp4 -pp camlp4orf junk.cmo 
> camlp4orf.cma -c
> ~/src/camlp4-beta jehenrik$ ocamlc -I +camlp4 -pp camlp4orf 
> camlp4orf.cma -c
> I/O error: " No such file or directory"
> Preprocessor error

In general, a syntax extension that (like before) uses quotations in the 
revised syntax would be compiled using such a command:

ocamlc -c -I +camlp4 -pp camlp4orf

It replaces

ocamlc -c -I +camlp4 -pp 'camlp4o pa_extend.cmo q_MLast.cmo'

There might be some slight error in the commands I just wrote (it 
happens). You can have a look at my updated json-static package that 
you'll find on my web site. It supports both the old and the new camlp4, 
and it works for sure with 3.10.0+beta [it uses two different source files 
of course].


Martin Jambon