├── lwtlib ├── dune-project ├── src │ ├── main.ml │ └── dune └── lwtlib.opam ├── dynlinker ├── main.ml ├── dune └── .merlin └── README.md /lwtlib/dune-project: -------------------------------------------------------------------------------- 1 | (lang dune 1.7) 2 | (name lwtlib) -------------------------------------------------------------------------------- /lwtlib/src/main.ml: -------------------------------------------------------------------------------- 1 | 2 | 3 | let foo _ = Lwt_main.run (Lwt_io.printl "Hello, world!" ) -------------------------------------------------------------------------------- /dynlinker/main.ml: -------------------------------------------------------------------------------- 1 | let () = Findlib.init () 2 | let () = Fl_dynload.load_packages ~debug:false ["lwtlib"] 3 | -------------------------------------------------------------------------------- /dynlinker/dune: -------------------------------------------------------------------------------- 1 | ( executable 2 | (name main) 3 | (libraries findlib.dynload) ; Add lwt.unix to succeed 4 | (flags -linkall) 5 | ) -------------------------------------------------------------------------------- /lwtlib/src/dune: -------------------------------------------------------------------------------- 1 | ( library 2 | (name lwtlib) 3 | (public_name lwtlib) 4 | (libraries lwt lwt.unix) 5 | ; (flags -linkall) Does not help 6 | ) -------------------------------------------------------------------------------- /dynlinker/.merlin: -------------------------------------------------------------------------------- 1 | EXCLUDE_QUERY_DIR 2 | B /home/philip/.opam/bappy4/lib/findlib 3 | B /home/philip/.opam/bappy4/lib/ocaml 4 | B ../../_build/default/link_failure_simple/dynlinker/.main.eobjs/byte 5 | S /home/philip/.opam/bappy4/lib/findlib 6 | S /home/philip/.opam/bappy4/lib/ocaml 7 | S . 8 | FLG -linkall 9 | -------------------------------------------------------------------------------- /lwtlib/lwtlib.opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | name: "lwtlib" 3 | version: "0.1" 4 | synopsis: "" 5 | description: """ 6 | 7 | """ 8 | maintainer: "Phil" 9 | authors: [ 10 | "Philip Zucker " 11 | ] 12 | license: "MIT" 13 | homepage: "" 14 | bug-reports: "" 15 | dev-repo: "" 16 | depends: [ 17 | "lwt" {>= "5.3.0"} 18 | ] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | To run: 2 | 3 | 4 | ``` 5 | cd lwtlib 6 | dune build 7 | dune install 8 | 9 | cd ../dynlinker 10 | dune exec ./main.exe 11 | ``` 12 | Entering directory '/home/philip/Documents/ocaml/vibes-foolin' 13 | Done: 0/0 (jobs: 0)Entering directory '/home/philip/Documents/ocaml/vibes-foolin' 14 | Fatal error: exception Dynlink.Error (Dynlink.Cannot_open_dll "Dynlink.Error (Dynlink.Cannot_open_dll \"Failure(\\\"/home/philip/.opam/bappy4/lib/lwt/unix/lwt_unix.cmxs: undefined symbol: caml_mutex_lock\\\")\")") 15 | ``` 16 | 17 | ocaml-base-compiler.4.09.1 18 | lwt : 5.3.0 19 | 20 | 21 | Adding lwt.unit to the dunefile in dynlinker makes it no longer fail. 22 | 23 | Related issue https://github.com/ocaml/dune/issues/2100 24 | 25 | 26 | --------------------------------------------------------------------------------