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] unbound value Parser.main?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <markus@m...>
Subject: Re: [Caml-list] unbound value Parser.main?
On Thu, 30 Aug 2001, Michael Leary wrote:
> doh!  the OcamlMakefile... is picky about names.
> I've got it like this now:
> SOURCES = lexer.mll parser.mly 
> RESULT = fbot
> LIBS=str

Simple answer: you have to put the files in the Makefile into the right
order. Since the generated module 'Lexer' depends on 'Parser' and module
'Fbot' on both you should write:

  SOURCES = parser.mly lexer.mll 

This should get rid of the problem. (In short: people have to
topologically sort the files according to their dependencies and sort
them totally wrt. their linking order).

Because the order of the modules also plays a role during linking (and
linking order matters, too, for side-effects!), there doesn't seem to
be any alternative to specifying the order manually in the general case.

Making files compile and link correctly by taking into account the
dependies only would make things much more complicated without really
solving the problem. It only gives the user the false sense that order
doesn't matter.

Markus Mottl

Markus Mottl                                   
Austrian Research Institute
for Artificial Intelligence        
Bug reports:  FAQ:
To unsubscribe, mail  Archives: