Loading ...
Sorry, an error occurred while loading the content.

13955Re: "ocaml_beginners"::[] OASIS help: can't build project that depends on core

Expand Messages
  • Chingfan Tsou
    Sep 7, 2013
    View Source
    • 0 Attachment
      No wonder why I keep getting the same error! I totally misunderstood the differences between toplevel and file compilation. Thanks for pointing it out~Now the building process is working just fine!


      2013/9/8 Philippe Veber <philippe.veber@...>
       

      Hi,

      There is indeed no Expr.Table module in your project. However there is an Expr.Expr.Table one :o)

      When you compile a file name foo.ml, this automatically defines a module named Foo. If you start the file foo.ml with module Foo = struct ... end, you're defining a submodule Foo of the module Foo. Let's see that on an example:

      foo.ml:
      let a = 1
      module Foo = struct
        let b = 41
      end


      bar.ml:
      let c = Foo.a + Foo.Foo.b

      Please refer to the manual [1] for a more thorough explanation, and do not hesitate to ask again if things are not clear yet.

      Cheers,
        Philippe.

      [1] http://caml.inria.fr/pub/docs/manual-ocaml/manual004.html#toc17


      2013/9/6 Chingfan Tsou <caojingfan@...>


      Yes, of course. Sorry that I thought it would be enough to solve this just with my description.


      here it is, and thank you very much!


      2013/9/6 Gabriel Scherer <gabriel.scherer@...>
       

      It's hard to help you without a reproducible setting to test. Could you send somewhere a zip of your project (or a reduced version thereof that reproduces the issue)?


      On Thu, Sep 5, 2013 at 4:30 PM, Chingfan Tsou <caojingfan@...> wrote:


      I just figured it may be useful if I learned how to use oasis. Sadly it turns out that it can be pretty challenge :(

      I tried with the command "ocamlbuild -lib expr.cmo autmt.native" just now but still got the same error. Was I doing this right?


      2013/9/5 Hongbo Zhang <hongboz@...>
       

      Hi,
         For toy projects, there's no need to use oasis.
         OCamlbuild would suffice


      On Thu, Sep 5, 2013 at 9:50 AM, Chingfan Tsou <caojingfan@...> wrote:
       

      Hi~again I ran into troubles with this little project and I was hoping anyone could help me out. Thanks in advance.

      Currently there are 3 files (described in the first mail) in this little project and one depends on the other like this: 

      rep.cmo : expr.cmo autmt.cmo
      rep.cmx : expr.cmx autmt.cmx

      autmt.cmo : expr.cmo
      autmt.cmx : expr.cmx

      expr.ml doesn't have the kind of inside-project dependencies.

      The problem is expr.ml has internal modules like Expr.Table and is referenced in autmt.ml.I tried this command 'ocamlfind ocamlc -c -package core -thread expr.cmo -o autmt.cmo autmt.ml' but failed with 

      File "autmt.ml", line 8, characters 17-34:
      Error: Unbound module Expr.Table

      So could anyone tell me what exactly should the build command be and what am I supposed to do with the _oasis file so that oasis can work properly? Thanks a lot!




      --
      -- Regards, Hongbo










    • Show all 11 messages in this topic