I've got this program called threadtest.ml
:
Thread.join (Thread.create (fun _ -> print_string "Hello, World!\n") ())
I'm compiling it like so:
$ 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
This is what version of ocamlc
I have.
$ ocamlc -v
The OCaml compiler, version 4.02.3
Standard library directory: /usr/lib/ocaml
What am I doing wrong? I've not found any explanation of this error.
UPDATE:
I've also tried rebasing my system by following the instructions here: https://stackoverflow.com/a/37616907/714167
But nothing seems to be working.