Skip to content

Attempt to #require "luv" in OCaml toplevel fails on Windows #142

@polytypic

Description

@polytypic

An attempt to #require "luv" in OCaml toplevel fails on Windows. Here is sample output:

OCaml version 4.14.0
Enter #help;; for help.

# #use "topfind";;
- : unit = ()
Findlib has been successfully loaded. Additional directives:
  #require "package";;      to load a package
  #list;;                   to list the available packages
  #camlp4o;;                to load camlp4 (standard syntax)
  #camlp4r;;                to load camlp4 (revised syntax)
  #predicates "p,q,...";;   to set these predicates
  Topfind.reset();;         to force that packages will be reloaded
  #thread;;                 to enable threads

- : unit = ()
# #require "luv";;
C:\Users\polytypic\work\opamroot\4.14.0\lib\bigarray-compat: added to search path
C:\Users\polytypic\work\opamroot\4.14.0\lib\bigarray-compat\bigarray_compat.cma: loaded
C:\Users\polytypic\work\opamroot\4.14.0\lib\bytes: added to search path
C:\Users\polytypic\work\opamroot\4.14.0\lib\stdlib-shims: added to search path
C:\Users\polytypic\work\opamroot\4.14.0\lib\stdlib-shims\stdlib_shims.cma: loaded
C:\Users\polytypic\work\opamroot\4.14.0\lib\integers: added to search path
C:\Users\polytypic\work\opamroot\4.14.0\lib\integers\integers.cma: loaded
C:\Users\polytypic\work\opamroot\4.14.0\lib\ctypes: added to search path
C:\Users\polytypic\work\opamroot\4.14.0\lib\ctypes\ctypes.cma: loaded
C:\Users\polytypic\work\opamroot\4.14.0\lib\ctypes\ctypes-top.cma: loaded
C:\Users\polytypic\work\opamroot\4.14.0\lib\luv\c_type_descriptions: added to search path
C:\Users\polytypic\work\opamroot\4.14.0\lib\luv\c_type_descriptions\luv_c_type_descriptions.cma: loaded
C:\Users\polytypic\work\opamroot\4.14.0\lib\luv\c_function_descriptions: added to search path
C:\Users\polytypic\work\opamroot\4.14.0\lib\luv\c_function_descriptions\luv_c_function_descriptions.cma: loaded
C:\Users\polytypic\work\opamroot\4.14.0\lib\ocaml: added to search path
C:\Users\polytypic\work\opamroot\4.14.0\lib\luv\c: added to search path
C:\Users\polytypic\work\opamroot\4.14.0\lib\luv\c\luv_c.cma: loaded
No master relocation table
Cannot load required shared library dllluv_c_stubs.
Reason: C:\Users\polytypic\work\opamroot\4.14.0\lib/stublibs\dllluv_c_stubs.dll: Cannot resolve ntohs.
C:\Users\polytypic\work\opamroot\4.14.0\lib\result: added to search path
C:\Users\polytypic\work\opamroot\4.14.0\lib\result\result.cma: loaded
C:\Users\polytypic\work\opamroot\4.14.0\lib\luv: added to search path
C:\Users\polytypic\work\opamroot\4.14.0\lib\luv\luv.cma: loaded
Line 1:
Error: Reference to undefined global `Luv_c_generated_functions'

The same seems to happen with other OCaml tools (I've tested utop and mdx) that run OCaml bytecode and also with other OCaml versions (I've tested with 5.0.0).

The No master relocation table message seems to point to flexdll which is used by OCaml on Windows.

I don't know how to exactly fix this problem, but my understanding is that with flexdll one needs to link applications and libraries using the special flexlink tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions