You say you're using Getopt
, "so" you have open Getopt
in your code. But there's no direct connection there. It's more usual (and in my opinion usually better) to use modules without opening them.
The use of open
only controls the names available in the containing module. It doesn't tell the compiler where to look for the opened modules.
There's no Getopt
module in the standard OCaml library. The standard module for parsing command lines is named Arg
. If you're using an external library, you need to use the -I
flag to tell the compiler where to look for it.
The .ocamlinit
file controls the behavior of the OCaml toplevel (the read-eval-print interpreter). It doesn't affect the behavior of compilers.
If you're using a building tool, there are probably easier ways to set things up. But you'll need to explain your build environment more carefully.