[Mono-list] Compile error - cannot find type 'Form'

Andy Levine andyl@epicrealm.com
Fri, 10 Jan 2003 11:35:38 -0600


Jonathan

>> mcs swftest.cs -r:System.Windows.Forms.dll
Thanks, it was the "-r" that was missing.

>>However, *running* swftest.exe is a different problem.
I actually get a different set of errors when I try to run:

** (SimpleHelloWorld.exe:22202): WARNING **: Failed to load library
libuser32.dll.so (user32.dll): libuser32.dll.so: cannot open shared
object file: No such file or directory

Unhandled Exception: System.NullReferenceException: Object reference not
set to an instance of an object
in <0x00025> 06 System.Windows.Forms.Win32:RegisterClass
(System.Windows.Forms.WNDCLASS&)
in <0x000dd> 00 System.Windows.Forms.ScrollableControl:get_CreateParams
()
in <0x00012> 00 System.Windows.Forms.ContainerControl:get_CreateParams
()
in <0x00012> 00 System.Windows.Forms.Form:get_CreateParams ()
in <0x00062> 00 System.Windows.Forms.Control:CreateHandle ()
in <0x00012> 00 System.Windows.Forms.Form:CreateHandle ()
in <0x003d8> 00 System.Windows.Forms.Control:.ctor ()
in <0x00015> 00 System.Windows.Forms.ScrollableControl:.ctor ()
in <0x00014> 00 System.Windows.Forms.ContainerControl:.ctor ()
in <0x00043> 00 System.Windows.Forms.Form:.ctor ()
in <0x00014> 00 .SimpleHelloWorld:.ctor ()
in <0x00024> 00 .SimpleHelloWorld:Main (string[])


On Fri, 2003-01-10 at 11:45, Andy Levine wrote:
> I just installed mono 0.17 from the RPMs (mono and mono-devel) on RH
> 7.1. I can successfully compile and run console applications, but any
> class I try to compile that uses System.Windows.Forms gives me the
> following error:
> 
> 	SimpleHelloWorld.cs(15) error CS0246: Cannot find type `Form'
> 	Compilation failed: 1 error(s), 0 warnings
> 
> I have the simplest of classes (actually sample code form the .NET
SDK),
> shown below:
> -----------------------------------------------------------------
> 	using System;
> 	using System.Windows.Forms;
> 
> 	public class SimpleHelloWorld : Form {
> 	    [STAThread]
> 	    public static int Main(string[] args) {
> 	        Application.Run(new SimpleHelloWorld());
> 	        return 0;
> 	    }
> 
> 	    public SimpleHelloWorld() {
> 	        this.Text = "Hello World";
> 	    }
> 	}
> -------------------------------------------------------------------
> I think I have everything I need. I found System.Windows.Forms.dll in
> /usr/lib. I even ildasm'ed it from my Windows box and found all the
> classes in there (including Form).
> 
> Any hints?
> 
> Thanks
> Andy
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list