Compiling multiple Ocaml files

后端 未结 2 1896
醉酒成梦
醉酒成梦 2021-01-18 19:34

I am new to Ocaml and trying to write some small example application. I am using ocamlc version 3.11.2 under Linux Ubuntu 10.04. I want to compile two files:

2条回答
  •  -上瘾入骨i
    2021-01-18 19:57

    It would be clearer if you showed the code that's not working. As Kristopher points out, though, the most likely problem is that you're not specifyig which module foo is in. You can specify the module explicitly, as A.foo. Or you can open A and just use the name foo.

    For a small example it doesn't matter, but for a big project you should be careful not to use open too freely. You want the freedom to use good names in your modules, and if you open too many of them, the good names can conflict with each other.

提交回复
热议问题