According to this "Error: unbound module" in OCaml
I should be able to run this
#use "topfind";;
#require "lwt";;
#require "cohttp-lwt-unix";;
as ocaml my_test1.ml
But after I've installed all the libraries and running it as such, I have an error:
$ ocaml my_test.ml
Cannot find file topfind.
Unknown directive `require'.
update
$ ocaml my_test.ml
File "./my_test.ml", line 1:
Error: Reference to undefined global `Mutex'
update2
#use "topfind";;
#require "lwt";;
#require "cohttp-lwt-unix";;
#thread;;
open Cohttp
open Lwt
open Cohttp
open Cohttp_lwt_unix
let () =
Printf.printf ("test1")
;;
and
eval `opam config env`
ocaml test1.ml
same error:
File "./test1.ml", line 1:
Error: Reference to undefined global `Mutex'