diskuv / dkml-installer-ocaml

The Windows-friendly distribution of OCaml
Apache License 2.0
63 stars 2 forks source link

`ocamlfind -linkpkg` fails with `Cannot find file "ws2_32.lib"` #33

Closed apsheronets closed 1 year ago

apsheronets commented 1 year ago
> cat .\hello.ml
Lwt_main.run (Lwt_io.printf "Hello, world!\n")
> ocamlfind ocamlopt -thread -package lwt,lwt.unix -c hello.ml
> ocamlfind ocamlopt -thread -package lwt,lwt.unix -linkpkg -o hello hello.cmx
** Fatal error: Cannot find file "ws2_32.lib"
File "caml_startup", line 1:
Error: Error during linking (exit code 2)

The build using dune is working fine by the way. So, is there any way to use ocamlfind with dkml?

jonahbeckford commented 1 year ago

If you don’t want to use a switch, stick with-dkml in front of commands.

So with-dkml ocamlfind. Today only dune and opam are built specially so that they don’t need with-dkml.

jonahbeckford commented 1 year ago

The third option: You can also use Microsoft’s x64 Native Tools Command Prompt as well to avoid most need for with-dkml.

apsheronets commented 1 year ago

Yep, with-dkml ocamlfind works just fine. Thanks! Well, at least I created a googlabe issue.