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: 3508 Reporter: administrator Status: closed Resolution: not a bug Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Daniel Weil
Version: 3.08
OS: Windows
Submission from: 81.80.88.226 (81.80.88.226)
Why is there a difference between linking .cmx files and linking .cmxa files ?
When linking .cmxa files, it seems that some static values are ignored.
Given a file called "truc.ml" and containing the code :
open Printf
let _ =
printf "coucou\n"
Compile this program with :
ocamlopt -c truc.ml
ocamlopt -o truc.exe truc.cmx
truc.exe
This output is "coucou"
Compile the same program with :
ocamlopt -c truc.ml
ocamlopt -a -o truc.cmxa truc.cmx
ocamlopt -o truc.exe truc.cmxa
truc.exe
Nothing is printed!!!
Why ? Is it a bug ?
The text was updated successfully, but these errors were encountered:
Why is there a difference between linking .cmx files and linking
.cmxa files ? When linking .cmxa files, it seems that some static
values are ignored.
[...]
Why ? Is it a bug ?
No, it's a feature. Modules in .cmxa files that are not referenced in
the program are not linked, as described in the reference manual.
You can turn this behaviour off with the -linkall option, which forces
all modules in .cmxa files to be linked in.
Original bug ID: 3508
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Daniel Weil
Version: 3.08
OS: Windows
Submission from: 81.80.88.226 (81.80.88.226)
Why is there a difference between linking .cmx files and linking .cmxa files ?
When linking .cmxa files, it seems that some static values are ignored.
Given a file called "truc.ml" and containing the code :
open Printf
let _ =
printf "coucou\n"
Compile this program with :
ocamlopt -c truc.ml
ocamlopt -o truc.exe truc.cmx
truc.exe
This output is "coucou"
Compile the same program with :
ocamlopt -c truc.ml
ocamlopt -a -o truc.cmxa truc.cmx
ocamlopt -o truc.exe truc.cmxa
truc.exe
Nothing is printed!!!
Why ? Is it a bug ?
The text was updated successfully, but these errors were encountered: