Results 1 to 14 of 14

Thread: how to compile

  1. #1

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    Question 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

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  3. #3
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    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!!

  4. #4
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: how to compile

    Or MonoDevelop...



    - ØØ -

  5. #5

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    Re: how to compile

    I downloaded the "Sharp DEVELOPE"yesterday..and unzipped it..but always get an error..I could not got it work !!!!

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how to compile

    What error are you getting?

  7. #7

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    Question Re: how to compile

    somthing like "NTVDM CPU..illegal..)
    close/ignore !!
    Today I unistalled it...What compiler do you suggest me for C#?
    thanks

  8. #8
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: how to compile

    Sharpdevelop sucks. Its a pile of rubbish. Get VS2005 beta instead, its free.
    I don't live here any more.

  9. #9
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: how to compile

    Or mono...it is freeer...

  10. #10
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: how to compile

    Quote 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!!

  11. #11
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: how to compile


  12. #12

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    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

  13. #13
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    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.

  14. #14
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    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
  •  



Click Here to Expand Forum to Full Width