我有了這個程序叫做threadtest.ml
:如何鏈接Cygwin中的Thread模塊?
Thread.join (Thread.create (fun _ -> print_string "Hello, World!\n")())
我編譯它,如下所示:
$ ocamlc -thread unix.cma threads.cma -o threadtest threadtest.ml
File "threadtest.ml", line 1:
Error: Error on dynamically loaded library: /usr/lib/ocaml/stublibs/dllunix.so: flexdll error: cannot relocate RELOC_REL32, target is too far: 0xfffffffc020c7112 0x20c7112
這是我有什麼版本的ocamlc
。
$ ocamlc -v
The OCaml compiler, version 4.02.3
Standard library directory: /usr/lib/ocaml
我在做什麼錯?我還沒有找到這個錯誤的任何解釋。
UPDATE:
我也試着按照這裏的說明基礎重建我的系統:https://stackoverflow.com/a/37616907/714167
,但似乎沒有奏效。
的[錯誤與在Cygwin Ocaml程序編寫線程模塊鏈接]可能的複製(http://stackoverflow.com/questions/37647206/error-linking-with-ocaml-thread-module-on-cygwin) – camlspotter
你應該用這個代碼示例改進了你以前的問題。 – camlspotter
沒有人回答這個問題,所以我沒有回答這個問題,沒有項目特定的信息,希望這會鼓勵人們看到它。我刪除了上一個問題。 –