caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dimitri Timofeev <dt@dt7463.spb.edu>
To: OCaml mailing list <caml-list@inria.fr>
Subject: [Caml-list] Dynamic module loading
Date: Mon, 12 Nov 2001 00:21:46 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.30.0111112333250.1471-100000@localhost.localdomain> (raw)

Greetings!

Thanks to all for your help! Your answers were very useful for me.

There is another question at the same subject. Can i use LablTk in
dynamically loaded module? I've tried and i've encountered a problem.

I take some code (i.e. eyes.ml) using LablTk. I write an example
that should be able to load modules:

let main () =
    try
        Dynlink.init ();
        Dynlink.add_interfaces ["Pervasives"; "Printexc"; "Tk"; "Frame"]
                               [Sys.getcwd (); "/usr/lib/ocaml";
                                "/usr/lib/ocaml/labltk"];
        Dynlink.loadfile Sys.argv.(1)
    with
    | Dynlink.Error e ->
        print_string "Dynamic linking error: ";
	print_string (Dynlink.error_message e);
	print_newline ()
;;

let _ = main ()
;;

I compile main.ml with command line "ocamlc -o main dynlink.cma main.ml"
and eyes.ml with "ocamlc -c -I +labltk eyes.ml".

Then i try to call it: "./main eyes.cmo", and i get Dynlink.Error
exception saying that there is no implementation available for Support.
But if i try to add "Support" into modules list, i get exception
Not_found. It seems right, because i have no "support.cmi" file.

Do i have some mistakes in my code or command lines, or i'm going a wrong
way?

Thanks again for your help. I'm very glad to be on this list.

Dimitri


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


             reply	other threads:[~2001-11-11 21:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-12  5:21 Dimitri Timofeev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-11-10 23:27 Dimitri Timofeev
2001-11-11  0:15 ` Michael Hicks
2001-11-11 22:09   ` Vitaly Lugovsky
2001-11-12 11:22     ` Fabrice Le Fessant
2001-11-11  1:00 ` malc
2001-11-11 16:45 ` Xavier Leroy

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=Pine.LNX.4.30.0111112333250.1471-100000@localhost.localdomain \
    --to=dt@dt7463.spb.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).