[Mono-list] compiling hello.cs

Jonathan Stowe gellyfish@gellyfish.com
Mon, 1 Apr 2002 10:49:30 +0100 (BST)


On 31 Mar 2002, prashant mahesh patel wrote:

> compiles
> mcs hello.cs gives this. still not able to get an exe
> out.
>
> syntax error, expecting end-of-file EOF ABSTRACT BOOL
> BYTE CHAR CLASS CONST DECIMAL DELEGATE DOUBLE ENUM
> EVENT EXPLICIT EXTERN FLOAT IMPLICIT INT INTERFACE
> INTERNAL LONG NAMESPACE NEW OBJECT OVERRIDE PRIVATE
> PROTECTED PUBLIC READONLY SBYTE SEALED SHORT STATIC
> STRING STRUCT UINT ULONG UNSAFE USHORT VIRTUAL VOID
> VOLATILE CLOSE_BRACE OPEN_BRACKET SEMICOLON TILDE
> IDENTIFIER
> ./hello.cs (10,1), Token:259 detail:   : Parsing error
> Mono.CSharp.yyParser.yyException
> irrecoverable syntax
> errorMono.CSharp.yyParser.yyExceptionin
> Mono.CSharp.CSharpParser:yyparse ()
>
> error CS5001: Program ./hello.exe does not have an
> entry point defined
> RESULT: 1
>

I have seen this when there is a missing semi-colon somewhere - that is to
say that:

using System;

class Hello
{
   public static void Main ()
   {
     Console.WriteLine("Hello, World")
   }

}

Will emit that message, replacing the semicolon will fix it.

I can't recreate the 'no entry point' message in the same file but this
will occur when the signature of Main() is incorrect or if it it missing
altogether.

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |