caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Stéphane Glondu" <steph@glondu.net>
To: guillaume.yziquel@bluebottle.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Compiling recursive modules into a .cma.
Date: Mon, 20 Oct 2008 15:51:29 +0200	[thread overview]
Message-ID: <48FC8CE1.6020401@glondu.net> (raw)
In-Reply-To: <200810181507.m9IF7jLI025373@mi1.bluebottle.com>

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


  reply	other threads:[~2008-10-20 13:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-18 15:06 Guillaume Yziquel
2008-10-20 13:51 ` Stéphane Glondu [this message]
2008-10-21  4:54   ` [Caml-list] " Guillaume Yziquel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48FC8CE1.6020401@glondu.net \
    --to=steph@glondu.net \
    --cc=caml-list@inria.fr \
    --cc=guillaume.yziquel@bluebottle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).