PDA

View Full Version : Mono mcs not working



dann
30th March 2006, 02:31 PM
Has anyone been using mono on FC5. I can seem to get the compiler to work. I can't even get the simplest thing to work:

####################################
using System;
namespace Dela.Mono.Examples
{
public class HelloWorld
{
public static void Main()
{
Console.WriteLine("Hello World");
}
}
}
#########################
$ mcs test.cs
test.cs(5,17): error CS8025: Parsing error
Compilation failed: 1 error(s), 0 warnings

I tried a simple form:
############
using System;
using System.Drawing;
using System.Windows.Forms.

namespace Naughton
}
public class MyForm : Form
{
public MyForm()
{
this.Text = "This is the form";
}
public static void Main()
{
Application.Run(new MyForm());
}
}
}
########################
$mcs test.cs
syntax error, got token `NAMESPACE'
test.cs(5,1): error CS1041: Identifier expected: `namespace' is a keyword
Compilation failed: 1 error(s), 0 warnings

I can bring them over to a windows machine, build them there, and run them in mono?

sej7278
30th March 2006, 07:27 PM
i got mcs to work with the novell rpm's for fc4, but windows.forms stuff does not work at all it seems to me, don't know if that's changed in the stuff that's bundled with fc5.

dann
31st March 2006, 05:00 PM
I tried the fc4 installation with the rpms from the novell site. They work well.


FC5:
$ rpm -qa | grep mono
mono-data-oracle-1.1.13.4-2
mono-winforms-1.1.13.4-2
mono-core-1.1.13.4-2
mono-data-1.1.13.4-2
mono-data-sybase-1.1.13.4-2
mono-data-postgresql-1.1.13.4-2
mono-nunit-1.1.13.4-2
mono-web-1.1.13.4-2
mono-data-sqlite-1.1.13.4-2

FC4:
$ rpm -qa | grep mono
mono-web-1.1.13.6-0.novell
mono-data-oracle-1.1.13.6-0.novell
mono-nunit-1.1.13.6-0.novell
mono-data-1.1.13.6-0.novell
monodoc-core-1.1.13-0.novell
mono-data-postgresql-1.1.13.6-0.novell
mono-data-sqlite-1.1.13.6-0.novell
mono-core-1.1.13.6-0.novell
monodevelop-0.9-2.novell
mono-winforms-1.1.13.6-0.novell
mono-data-sybase-1.1.13.6-0.novell

The FC5 ones are older and don't seem to work - at least the compiler

LLS
31st March 2006, 06:32 PM
hello.cs

using System;

class first {
public static void Main (string[] args)
{
Console.WriteLine ("Hello,World!");
}
}


mcs hello.cs

mono hello.exe
#Hello,World

dann
3rd April 2006, 08:20 PM
I couldn't get the compiler to work. It worked on FC4 with the rpms from novell, and FC5 with the rpms from the distro. But it refused to work on the FC4=>FC5 upgrade version with the rpms from the FC5 distro. Something that mcs uses was different, but I couldn't figure it out. (rpm -q --whatprovides mono-core).

I reinstalled FC5, this time doing an install rather than an upgrade (formatted everything, etc). It works fine now. All the code examples from above, all the projects I was working on, etc. I couldn't figure it out, but I don't have to worry about it anymore. Thanks for eveyones suggestions. :)

LLS
4th April 2006, 12:34 AM
Could you show us a locate mono* result so I can compare to mine, I tried running some more complex programs and they would not compile either. I seem to have a mono1 and mono2 set of libs to r to.