We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Original bug ID: 2667 Reporter: administrator Status: acknowledged Resolution: open Priority: normal Severity: feature Category: otherlibs
Full_Name: James Scott Version: 3.07+2 OS: Linux and Windows Submission from: d80-170-139-232.cust.tele2.fr (80.170.139.232)
When using Dynlink from the Toplevel:
Modules which are loaded by #load or given on the command line are not resolved from Dynlink-loaded code.
e.g.
$ cat Loader.ml let dynload_helper_ref = ref (None: int option)
let doit fname = let _ = Dynlink.init () in let _ = Dynlink.loadfile fname in !dynload_helper_ref
$ cat Loadee.ml Loader.dynload_helper_ref := Some 1
$ cat Test.ml let _ = Loader.doit "Loadee.cmo" ;;
$ ocamlc -c Loadee.ml $ ocamlc -a -o llib.cma Loader.ml $ ocaml dynlink.cma llib.cma Test.ml Exception: Dynlink.Error (Dynlink.Linking_error ("Loadee.cmo", Dynlink.Undefined_global "Loader")).
But this works:
$ ocamlmktop dynlink.cma llib.cma $ ./a.out < Test.ml Objective Caml version 3.07+2
The text was updated successfully, but these errors were encountered:
Comment author: administrator
the example is not good, but the point is valid -DD 2004-06-15
Sorry, something went wrong.
This is a known deficiency and I believe there is now a proper error message.
No branches or pull requests
Original bug ID: 2667
Reporter: administrator
Status: acknowledged
Resolution: open
Priority: normal
Severity: feature
Category: otherlibs
Bug description
Full_Name: James Scott
Version: 3.07+2
OS: Linux and Windows
Submission from: d80-170-139-232.cust.tele2.fr (80.170.139.232)
When using Dynlink from the Toplevel:
Modules which are loaded by #load or given on the command line are not resolved
from Dynlink-loaded code.
e.g.
$ cat Loader.ml
let dynload_helper_ref = ref (None: int option)
let doit fname =
let _ = Dynlink.init () in
let _ = Dynlink.loadfile fname in
!dynload_helper_ref
$ cat Loadee.ml
Loader.dynload_helper_ref := Some 1
$ cat Test.ml
let _ = Loader.doit "Loadee.cmo" ;;
$ ocamlc -c Loadee.ml
$ ocamlc -a -o llib.cma Loader.ml
$ ocaml dynlink.cma llib.cma Test.ml
Exception:
Dynlink.Error
(Dynlink.Linking_error ("Loadee.cmo", Dynlink.Undefined_global "Loader")).
But this works:
$ ocamlmktop dynlink.cma llib.cma
$ ./a.out < Test.ml
Objective Caml version 3.07+2
- : int option = Some 1
The text was updated successfully, but these errors were encountered: