Re: "ocaml_beginners":: Threads.cma linking problems....
- On Sat, 1 May 2004, TBraibant wrote:
> Hello WorldWhen you link an OCaml program, order of the compilation units matters.
> I'm trying to develop an application based on threads.
> When I use the ocamlc -thread threads.cma myfile.ml unix.cma -c , there is no matter
> But when I use ocamlc -thread threads.cma myfile.ml unix.cma -o myprog I get an error
> -> Linking
> -> Error while linking /usr/lib/ocaml/3.07/threads/threads.cma(Thread):
> -> Reference to undefined global "'Unix'
> -> linking failed
> Is there something else special to do?
If a.cmo uses b.cmo, then b.cmo must be given first. You can't have
mutually recursive compilation units.
In your situation, the right order should be:
unix.cma threads.cma myfile.ml