Hello, Guillaume Yziquel wrote: > I've been recently trying to compile a module I made. I can load the > .cmo I generate out of it, but not the .cma I generate out of it. > [...] >> # #load "ocaml-yziquel.cma";; >> Reference to undefined global `Protection' >> [...]
IIUC, in this .cma, there are (at least) Protection and Chain modules, the latter depending on the former. However: > [...] > Here is the makefile: > [...] >> SOURCE = $(wildcard *.ml) >> [...] >> BYTE_COMPILED_OBJECT = $(SOURCE:.ml=.cmo) >> [...] >> ocaml-yziquel.cma: $(BYTE_COMPILED_INTERFACE) $(BYTE_COMPILED_OBJECT) >> $(OCAMLC) $(PACKAGES) -a -o ocaml-yziquel.cma $(BYTE_COMPILED_OBJECT) >> [...] It seems that chain.cmo is linked before protection.cmo inside the .cma. The order of modules inside of a .cma file is important. The behaviour is the same as if they were #loaded in the same order in a toplevel. Try writing explicitly all .ml files of $(SOURCE) in topological order. Cheers, -- Stéphane _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs