New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dynlink with local modules #3708
Comments
Comment author: administrator
Generally speaking, when a program dynlinks a module A that references This is not the case in your program because dynlink_main was not Now, why is it that the second module causes no errors? Well, Best regards,
|
Comment author: administrator Normal behaviour, see follow-up for explanations. |
Comment author: administrator Xavier Leroy writes: Generally speaking, when a program dynlinks a module A that references OK, then I would like to turn this into a feature wish: Please ocamlc -c -pp "camlp4r -impl" -impl mLast.mli although it might be preferably to have a save object file Bye, Hendrik |
Original bug ID: 3708
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Hi,
when I dynlink something like
I get a dynlink error "undefined global MLast. The equivalent
load fine.
I append three files to reproduce the problem. Check with
Bye,
Hendrik
let main () =
Dynlink.loadfile Sys.argv.(1)
;;
try
main ()
with
| Dynlink.Error e as ex ->
prerr_endline(Printexc.to_string ex);
Printf.fprintf stderr "Dynlink Error %s\n" (Dynlink.error_message e)
| x -> prerr_endline(Printexc.to_string x);
(*** Local Variables: )
( compile-command: "ocamlc -o dynlink_main dynlink.cma dynlink_main.ml" )
( End: ***)
let a =
let module M = MLast in M.loc_of_expr
(*** Local Variables: )
( compile-command: "ocamlc -I +camlp4 -c dynlink_loc.ml" )
( End: ***)
let a = MLast.loc_of_expr
(*** Local Variables: )
( compile-command: "ocamlc -I +camlp4 -c dynlink_nonloc.ml" )
( End: ***)
The text was updated successfully, but these errors were encountered: