[Mono-osx] Mono-1.1.6-4 on Mac OS X 10.3, System.Windows.Forms

Sergey Shandar sergey.monoosx@comrades.id.au
Tue, 26 Apr 2005 23:32:26 +0930


I still can't resolve the problem in this simple GUI program (main.cs):

using SWF = System.Windows.Forms;

class My
{
    public static void Main(string[] args)
    {
        SWF.MessageBox.Show("Hello world!");
    }
}



I compile and pack it

mcs main.cs /r:System.Windows.Forms.dll
macpack -n:main -a:main.exe -o:. -m:1



Then I execute main.app and have this error message in console.log:

Unhandled Exception: System.TypeInitializationException: An exception 
was thrown by the type initializer for MessageBoxForm --->
System.Reflection.TargetInvocationException: Exception has been thrown 
by the target of an invocation. --->
System.TypeInitializationException: An exception was thrown by the type 
initializer for System.Drawing.GDIPlus --->
System.DllNotFoundException: 
/Library/Frameworks/Mono.framework/Versions/1.1.6/lib/libgdiplus.dylib

in <0x000d8> (wrapper managed-to-native) 
System.Drawing.GDIPlus:GdiplusStartup 
(ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)

in <0x0011c> System.Drawing.GDIPlus:.cctor ()



But the required file exsists

ls /Library/Frameworks/Mono.framework/Versions/1.1.6/lib/libgdiplus.dylib
/Library/Frameworks/Mono.framework/Versions/1.1.6/lib/libgdiplus.dylib



I've also tried to change the configuration files like descrbed here
http://www.cocoasharp.org/cocoaSharp/default.aspx/CocoaSharp/WinFormsTutorial.html
but still have the error:

Unhandled Exception: System.TypeInitializationException: An exception 
was thrown by the type initializer for MessageBoxForm --->
System.Reflection.TargetInvocationException: Exception has been thrown 
by the target of an invocation. --->
System.TypeInitializationException: An exception was thrown by the type 
initializer for System.Drawing.GDIPlus --->
System.DllNotFoundException: 
/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib

in <0x000d8> (wrapper managed-to-native) 
System.Drawing.GDIPlus:GdiplusStartup 
(ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)

in <0x0011c> System.Drawing.GDIPlus:.cctor ()



But this file path also exsists

ls /Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib
/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib



What am I doing wrong?