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
RE: [Caml-list] ocamlmktop mystery
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
Subject: RE: [Caml-list] ocamlmktop mystery
The interface file is still in the lib directory.
you should do the follwing :
#directory "../lib";;
# Foo.add;;

The toplevel has to see the interface files .cmi in order to get the types, since this infomation is not in the compiled .cmo or .cmx.


-----Message d'origine-----
De :
[]De la part de Florian Weimer
Envoyé : vendredi 18 novembre 2005 13:46
À :
Objet : [Caml-list] ocamlmktop mystery

[Repost from comp.lang.functional]

I can't use ocamlmktop to build a toplevel using objects in a
different directory:

$ mkdir lib
$ echo let add a b = a + b > lib/
$ ocamlc -c lib/
$ ocamlmktop -I lib lib/foo.cmo
$ ./a.out
        Objective Caml version 3.08.3

# Foo.add;;
Unbound value Foo.add

However, changing to the directory first works as expected:

$ cd lib
$ ocamlmktop foo.cmo
$ /a.out
        Objective Caml version 3.08.3

# Foo.add;;
- : int -> int -> int = <fun>

What am I doing wrong?

Caml-list mailing list. Subscription management:
Beginner's list:
Bug reports:
Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et etablis a l'intention exclusive de ses
Toute utilisation ou diffusion non autorisee est interdite. 
Tout message electronique est susceptible d'alteration. 
SG Asset Management et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie.

Decouvrez l'offre et les services de SG Asset Management sur le site 


This message and any attachments (the "message") are confidential and intended solely for the addressees.
Any unauthorised use or dissemination is prohibited. 
E-mails are susceptible to alteration. 
Neither SG Asset Management nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or