Error Compiling

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Seelan Rajagopal

    #1

    Error Compiling

    Hey Guys!
    Im Compiling a simple program is the command promt. I have set all the
    paths needed to run the compiler. But when I use csc myprogram.cs, it says
    that the program does not have an entry point defined. Can someone please
    help me solve this problem?
    Thanks


  • rollasoc

    #2
    Re: Error Compiling

    Has it got a main function?

    "Seelan Rajagopal" <t-seeraj@microsof t.com.NO_SPAM> wrote in message
    news:#BBJ4zPtDH A.700@TK2MSFTNG P11.phx.gbl...[color=blue]
    > Hey Guys!
    > Im Compiling a simple program is the command promt. I have set all the
    > paths needed to run the compiler. But when I use csc myprogram.cs, it says
    > that the program does not have an entry point defined. Can someone please
    > help me solve this problem?
    > Thanks
    >
    >[/color]


    Comment

    • Jon Skeet [C# MVP]

      #3
      Re: Error Compiling

      Seelan Rajagopal <t-seeraj@microsof t.com.NO_SPAM> wrote:[color=blue]
      > Im Compiling a simple program is the command promt. I have set all the
      > paths needed to run the compiler. But when I use csc myprogram.cs, it says
      > that the program does not have an entry point defined. Can someone please
      > help me solve this problem?[/color]

      You need to have a class with one of the following methods:

      static void Main()
      static void Main(string[] args)
      static int Main()
      static int Main(string[] args)

      Or you could compile your code as a library, using the /t:library
      compiler option.

      --
      Jon Skeet - <skeet@pobox.co m>
      Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

      If replying to the group, please do not mail me too

      Comment

      • Miha Markic

        #4
        Re: Error Compiling

        Hi,

        Perhaps you are missing Main method:
        [STAThread]

        static void Main()

        {

        // here goes the code - starting point

        }


        --
        Miha Markic - RightHand .NET consulting & software development
        miha at rthand com

        "Seelan Rajagopal" <t-seeraj@microsof t.com.NO_SPAM> wrote in message
        news:%23BBJ4zPt DHA.700@TK2MSFT NGP11.phx.gbl.. .[color=blue]
        > Hey Guys!
        > Im Compiling a simple program is the command promt. I have set all the
        > paths needed to run the compiler. But when I use csc myprogram.cs, it says
        > that the program does not have an entry point defined. Can someone please
        > help me solve this problem?
        > Thanks
        >
        >[/color]


        Comment

        Working...