[Mono-list] Newbie - How to invoke compiler after installing?

Maser, Dan Dan.Maser at inin.com
Mon Mar 2 15:28:05 EST 2009

    It looks like you just have to quote the "c:\Mono Test\Simple.cs" on your command line since your directory has a space in it.

Dan Maser | Lead Software Developer
phone & fax +1.317.872.3000 | mobile +1.317.872.3000 | dan.maser at inin.com

Interactive Intelligence Inc.
Deliberately Innovative

-----Original Message-----
From: mono-list-bounces at lists.ximian.com [mailto:mono-list-bounces at lists.ximian.com] On Behalf Of lionel keene
Sent: Monday, March 02, 2009 2:25 PM
To: mono-list at lists.ximian.com
Subject: [Mono-list] Newbie - How to invoke compiler after installing?

Hello all, Mono newbie here. How do I compile the following example
(which I've entered via Microsoft Norepad and saved as "c:\Mono

using System.Windows.Forms;
using System.Drawing;

public class Simple : Form
    public Simple()
       Text = "Simple";
       Size = new Size(250, 200);

    static public void Main()
       Application.Run(new Simple());

I've installed Mono 2.2 using the default installation parameters on
my Wndows XP box. Then, at the command prompt, I tried changing to the
compiler directory (the directory containing gmcs.exe) via:

"cd c:\Program files\Mono-2.2\lib\mono\2.0"

Then I invoke the compiler and specify the file to compile using the following:

"gmcs -r:System.Windows.Forms.dll -r:System.Drawing.dll c:\Mono Test\simple.cs"

I get errors at compile time claimg "'Mono' could not be found" &
"Test\Simple.cs" could not be found.

After hunting aroud online I changed appended the following to my PATH
system variable:

";C:\Program Files\Mono-2.2\bin"

Then I changed directories to the one containing my csharp source:

"cd C:\Mono Test"

I then try to compile via:

"gmcs -r:System.Windows.Forms.dll -r:System.Drawing.dll c:\Mono Test\simple.cs"

I get an error claiming "gmcs is not recognized as an internal or
external command"

 What is the proper procedure for doing this? Thanks so much in advance!

Mono-list maillist  -  Mono-list at lists.ximian.com

More information about the Mono-list mailing list