fdopen / opam-repository-mingw

windows package repository for OPAM (mingw and msvc)
https://fdopen.github.io/opam-repository-mingw/
Creative Commons Zero v1.0 Universal
96 stars 33 forks source link

Variable bin not found #58

Closed ghost closed 4 years ago

ghost commented 5 years ago
$ ocaml-env exec hello.ml
[ERROR] Variable bin not found
fatal error:$(opam config var bin) failed
fdopen commented 5 years ago

Does opam config var bin work, if you execute the command inside a regular cygwin shell? If not, this is expected behaviour. This error can happen, if there is no opam switch or your switch is in an invalid state.

ghost commented 5 years ago

@fdopen um ok, so how to fix it?

fdopen commented 5 years ago

Just create a switch that works, e.g. with opam switch create 4.08.0+mingw64c

ghost commented 5 years ago
$ ocaml-env exec hello.ml
ocaml-env: internal error, uncaught exception:
           Unix.Unix_error(1, "create_process", "hello.ml")
fdopen commented 5 years ago

Well, you can't execute scripts under Windows, that only works under *nix. Try ocaml-env exec ocaml hello.ml instead. (And inside a cygwin terminal, you don't need ocaml-env exec ... at all, ocaml hello.ml is enough).