“Compile with /main to specify the type that contains the entry point.”

前端 未结 4 743
不思量自难忘°
不思量自难忘° 2021-02-08 06:20

Per the code below, I am getting the following message. I am fairly certain \"why\" I am getting it, I just don\'t know how to rearrange the code to move/remove/replace one of t

4条回答
  •  北荒
    北荒 (楼主)
    2021-02-08 07:06

    I had to do this manually for my implementation of Lox in C#. To "compile with /main" from the command line, I used

    csc /main:Lox.AstPrinter AstPrinter.cs Expr.cs Token.cs TokenType.cs
    

    or, more generally, if you want to compile class Foo in the Acme namespace, that also depends on files A.cs, B.cs, and C.cs:

    csc /main:Acme.Foo A.cs B.cs C.cs Foo.cs
    

提交回复
热议问题