Script started on Wed Oct 17 10:55:12 2007 % ls _tags hello.ml hw.mllib main.ml myocamlbuild.ml world.ml % cat _tags : use_hw % cat hello.ml let hello () = Printf.printf "hello " % cat world.ml let world () = Printf.printf "world!\n" % cat main.ml let () = Hello.hello (); World.world () % cat myocamlbuild.ml open Ocamlbuild_plugin;; open Command;; dispatch begin function After_rules -> flag ["ocaml"; "use_hw"; "link"; "byte"] (P "hw.cma"); flag ["ocaml"; "use_hw"; "link"; "native"] (P "hw.cmxa"); dep ["ocaml"; "use_hw"; "link"; "byte"] ["hw.cma"]; dep ["ocaml"; "use_hw"; "link"; "native"] ["hw.cmxa"] | _ -> () end % ocamlbuild -classic-display main.byte ocamlopt.opt -I +ocamlbuild unix.cmxa ocamlbuildlib.cmxa myocamlbuild.ml ocamlbuild.cmx -o myocamlbuild ocamldep.opt -modules main.ml > main.ml.depends ocamldep.opt -modules hello.ml > hello.ml.depends ocamldep.opt -modules world.ml > world.ml.depends ocamlc.opt -c -o hello.cmo hello.ml ocamlc.opt -c -o world.cmo world.ml ocamlc.opt -c -o main.cmo main.ml ocamlc.opt -a hello.cmo world.cmo -o hw.cma ocamlc.opt hw.cma hello.cmo world.cmo main.cmo hw.cma -o main.byte % ocamlbuild -classic-display main.native ocamlopt.opt -c -o hello.cmx hello.ml ocamlopt.opt -c -o world.cmx world.ml ocamlopt.opt -c -o main.cmx main.ml ocamlopt.opt -a hello.cmx world.cmx -o hw.cmxa ocamlopt.opt hw.cmxa hello.cmx world.cmx main.cmx hw.cmxa -o main.native + ocamlopt.opt hw.cmxa hello.cmx world.cmx main.cmx hw.cmxa -o main.native collect2: ld returned 1 exit status Error during linking Command exited with code 2. % Script done on Wed Oct 17 10:56:29 2007