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

Threads.cma linking problems....

Expand Messages
  • TBraibant
    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
    Message 1 of 2 , Apr 30, 2004
      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?

      Moreover can someone give me a good link on a manpage for ocamlfind... I wan't understand how to use it :(

      Thanks

      Thomas


      [Non-text portions of this message have been removed]
    • Martin Jambon
      ... 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
      Message 2 of 2 , May 1, 2004
        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
      Your message has been successfully submitted and would be delivered to recipients shortly.