|
-
Jul 20th, 2005, 02:19 AM
#1
Thread Starter
Fanatic Member
how to compile
hi,
I wanted to compile and run thee following C# program using "DOS SHELL window"
as described...but it did not work .All I can see is a blank notpad page..Which program should I
need to get it run...? What compiler need I use for C# program...?
> md C:\learncs
> cd C:\learncs
> C:
Then I create my first C# program, typeing"notepad hello.cs" and type (in the notepad)
Code:
using System;
public class Hello
{
public static void Main()
{
Console.WriteLine("Hello C# World :-)");
}
}
Is this how they compile C# programs?
Thanks
-
Jul 20th, 2005, 02:28 AM
#2
Re: how to compile
You can use the CSC.EXE utility to compile your C# app. You'd then run it by simply calling the EXE name.
-
Jul 20th, 2005, 02:35 AM
#3
Re: how to compile
search for sharpDevelope if you want a free IDE
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jul 20th, 2005, 02:37 AM
#4
-
Jul 20th, 2005, 02:39 AM
#5
Thread Starter
Fanatic Member
Re: how to compile
I downloaded the "Sharp DEVELOPE"yesterday..and unzipped it..but always get an error..I could not got it work !!!!
-
Jul 20th, 2005, 06:33 AM
#6
Re: how to compile
What error are you getting?
-
Jul 20th, 2005, 09:38 AM
#7
Thread Starter
Fanatic Member
Re: how to compile
somthing like "NTVDM CPU..illegal..)
close/ignore !!
Today I unistalled it...What compiler do you suggest me for C#?
thanks
-
Jul 20th, 2005, 09:42 AM
#8
Re: how to compile
Sharpdevelop sucks. Its a pile of rubbish. Get VS2005 beta instead, its free.
I don't live here any more.
-
Jul 20th, 2005, 09:52 AM
#9
Re: how to compile
Or mono...it is freeer...
-
Jul 20th, 2005, 12:56 PM
#10
Re: how to compile
 Originally Posted by wossname
Sharpdevelop sucks. Its a pile of rubbish. Get VS2005 beta instead, its free.
it expires you fool
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jul 20th, 2005, 03:27 PM
#11
Sleep mode
-
Jul 29th, 2005, 06:42 AM
#12
Thread Starter
Fanatic Member
Re: how to compile
I still have problem in getting C# files run...
I finaly tried an other "hello world"simple program and put that file in C:root
and from the DOS window I typed "hello.cs" then it said "MSVCR70.dll file was missing"
I downloaded that file and put it in "windows/system32" folder and tried the same program again..now it says "cscompui.dll" is missing although I put that new cssompui.dll file in system32 folder...
help me please will you?
thanks
-
Jul 31st, 2005, 08:13 PM
#13
Fanatic Member
Re: how to compile
Ok, we'll present steps. This is just one, and of course there are several other processes aside from this. But still, wanna get you started. I still don't know what you have on your machine but lemme get you started with my simple steps.
First off, download the .Net Framework here. The framework itself has the C# compiler called csc.exe. Note again, this is just one option, you can have Icazza's .Net version which is the mono from here. For the sake of this reply, I'll stick on .Net from M$.
Accessing the csc.exe (from any directory of the command line prompt) will require an environment variable Path to be edited (for WinXP/Win2k, might be editing autoexec.bat if you're on 9x). Right click on My Computer and Select Properties, Advanced Tab and click Environment Variables button, find Path on System variables and click Edit... Add ;C:\WINNT\Microsoft.NET\Framework\v1.1.4322 on the Variable value. Remember if you're on WinXP, WINNT is Windows so the variable becomes ;C:\Windows\Microsoft.NET\Framework\v1.1.4322. Also note that C: drive will vary from your system drive. Please check on this.
After editing the Path variable we can test the csc.exe on our C:\root directory. Type csc.exe and will get something like
Microsoft (R) Visual C# .NET Compiler version 7.00.9466
for Microsoft (R) .NET Framework version 1.0.3705
Copyright (C) Microsoft Corporation 2001. All rights reserved.
fatal error CS2008: No inputs specified
We can then type of our code into the directory, for example
Code:
public class hello{
public static int Main(){
System.Console.WriteLine("Hello World");
return 0;
}
}
Compile it by csc hello.cs and run it by hello. I guess this covers all. Mono btw, has mcs.exe compiler if I remember correctly.
-
Jul 31st, 2005, 08:18 PM
#14
Re: how to compile
You can also specify the path, or move the compiler to the system folder.
Thanks for the crash lesson.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|