Error Compiling

  • Thread starter Thread starter Seelan Rajagopal
  • Start date Start date
S

Seelan Rajagopal

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
 
Hi,

Perhaps you are missing Main method:
[STAThread]

static void Main()

{

// here goes the code - starting point

}
 
Seelan Rajagopal said:
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?

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top