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
[Caml-list] Dynamic module loading
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dimitri Timofeev <dt@d...>
Subject: [Caml-list] Dynamic module loading

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. using LablTk. I write an example
that should be able to load modules:

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

let _ = main ()

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

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

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


Bug reports:  FAQ:
To unsubscribe, mail  Archives: