Loading ...
Sorry, an error occurred while loading the content.

1901Re: "ocaml_beginners"::[] Threads.cma linking problems....

Expand Messages
  • Martin Jambon
    May 1 1:39 AM
      On Sat, 1 May 2004, TBraibant wrote:

      > Hello World
      >
      > 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?

      When you link an OCaml program, order of the compilation units matters.
      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


      Martin
    • Show all 2 messages in this topic