When I enter ocaml --version
it returns
/usr/bin/ocaml: unknown option '--version'.
I installed it using OPAM and ran the instructions
opam init eval $(opam env) eval opam env
opam switch create 4.07.0
and everything seemed to go fine. Entering which ocaml
returns a correct-looking path. And when entering a terminal session it seems to work fine. I don't see this error mentioned anywhere when I search for it.
OCaml tools are weird and usually do not follow the POSIX guidelines of using double dashes for command line options. At this point probably for historic reasons and because the standard Arg
module parses command line arguments this way. In any case, this will do the trick:
ocaml -version
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.