Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002667OCamlOCaml generalpublic2004-06-12 17:032004-06-15 16:47
Reporteradministrator 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002667: dynlink and toplevel
DescriptionFull_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






TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000224)
administrator (administrator)
2004-06-15 16:47

the example is not good, but the point is valid -DD 2004-06-15

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker