caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jean-Baptiste Jeannin <jeannin@cs.cornell.edu>
To: <caml-list@inria.fr>
Subject: [Caml-list] Compiling a file using the Toploop module
Date: Thu, 2 Aug 2012 19:55:28 -0400	[thread overview]
Message-ID: <501B1370.2090409@cs.cornell.edu> (raw)

Hi all,

I have been using the Toploop module in some code that I have always 
interpreted using the "ocaml" command. I am now trying to compile this 
code using "ocamlc", but I keep getting the following error:

File "try_toploop.ml", line 1, characters 0-1:
Error: Error while linking try_toploop.cmo:
Reference to undefined global `Toploop'


More precisely, this error can be reproduced with a file try_toploop.ml 
containing just the two lines:

module T = Toploop;;
print_int 0;;

It interprets fine with the ocaml interpreter (or as a matter of fact, 
in the toplevel system):
$ ocaml try_toploop.ml
0

However, if I try to compile it, I get:
$ ocamlc try_toploop.ml
File "try_toploop.ml", line 1, characters 0-1:
Error: Error while linking try_toploop.cmo:
Reference to undefined global `Toploop'

I am wondering how to compile such a file using ocamlc, or even if it is 
possible. I have been looking for possible options to include a pointer 
to a toploop.cmo, but could not solve the problem. Thank you for your help!

Jean-Baptiste Jeannin

             reply	other threads:[~2012-08-02 23:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02 23:55 Jean-Baptiste Jeannin [this message]
2012-08-03  0:21 ` Daniel Bünzli
2012-08-05 23:41   ` Jean-Baptiste Jeannin

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=501B1370.2090409@cs.cornell.edu \
    --to=jeannin@cs.cornell.edu \
    --cc=caml-list@inria.fr \
    /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).