2013-06-19 48 views

回答

8

對於頂層

ocaml -I +threads 

# #load "unix.cma";; 
# #load "threads.cma";; 
# Mutex.create();; 
- : Mutex.t = <abstr> 

對於ocamlc

ocamlc -thread unix.cma threads.cma src.ml 

對於ocamlopt

ocamlopt -thread unix.cmxa threads.cmxa src.ml 

對於findlib

ocamlfind ocamlc -thread -package threads -linkpkg src.ml