You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 2935 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Matthew W. Boyd
Version: 3.08.0
OS: Windows XP
Submission from: 65.247.218.12 (65.247.218.12)
When I compile a library and that library has a functor in it, the result will
not link. I was compiling a set of modules into a single .cmx file and then
putting that .cmx file into a .cmxa, but when I try to link it with a file that
uses a functor defined in the .cmxa, I get a link error. For example:
mm.mli:
module M(S : sig val x : int end) :
sig
val f : int -> int
end
mm.ml:
module M(S : sig val x : int end) =
struct
let f y = S.x + y
end
mm_tst.ml:
module M = Nmm.Mm.M(
struct
let x = 3
end);;
Printf.printf "k = %d\n" (M.f 5);;
flush stdout;;
When I compile a library and that library has a functor in it, the
result will not link.
Do you remember which MS Windows port of OCaml you used? Cygwin,
MinGW, or MSVC + objcopy and nm from Cygwin? That would help me
reproduce and track down the problem. Thanks.
Original bug ID: 2935
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Matthew W. Boyd
Version: 3.08.0
OS: Windows XP
Submission from: 65.247.218.12 (65.247.218.12)
When I compile a library and that library has a functor in it, the result will
not link. I was compiling a set of modules into a single .cmx file and then
putting that .cmx file into a .cmxa, but when I try to link it with a file that
uses a functor defined in the .cmxa, I get a link error. For example:
mm.mli:
module M(S : sig val x : int end) :
sig
val f : int -> int
end
mm.ml:
module M(S : sig val x : int end) =
struct
let f y = S.x + y
end
mm_tst.ml:
module M = Nmm.Mm.M(
struct
let x = 3
end);;
Printf.printf "k = %d\n" (M.f 5);;
flush stdout;;
Compile with:
ocamlc -c mm.mli
ocamlopt -c mm.ml
ocamlopt -pack -o nmm.cmx mm.cmx
ocamlopt -a -o nmm.cmxa nmm.cmx
ocamlopt -o mm_tst.exe nmm.cmxa mm_tst.ml
The compiler reports:
mm_tst.o(.text+0x16):fake: undefined reference to `_camlMm__M_62'
collect2: ld returned 1 exit status
Error during linking
The text was updated successfully, but these errors were encountered: