[Mono-list] Windows Forms App under Mac OS X Mono

jeff clausius jeffc at sourcegear.com
Thu Nov 29 21:15:27 UTC 2012


As mentioned it was already there.  The following will fix that problem:

change
/Library/Frameworks/Mono.framework/Versions/Current/etc/mono/config and
modified the entry to the full path of /usr/X11/lib/libX11.dylib.


Now, running 'MONO_MWF_MAC_FORCE_X11=1 mono yourapp.exe' generates a
similar error I was seeing under 2.10.9 as well:

Gtk not found (missing LD_LIBRARY_PATH to libgtk-x11-2.0.so.0?), using
built-in colorscheme

Unhandled Exception:
System.EntryPointNotFoundException: GdipCreateFromXDrawable_linux
  at (wrapper managed-to-native)
System.Drawing.GDIPlus:GdipCreateFromXDrawable_linux (intptr,intptr,intptr&)
  at System.Drawing.Graphics.FromXDrawable (IntPtr drawable, IntPtr
display) [0x00000] in <filename unknown>:0
  at System.Drawing.Graphics.FromHwnd (IntPtr hwnd) [0x00000] in
<filename unknown>:0
  at System.Windows.Forms.XplatUIX11.GetAutoScaleSize
(System.Drawing.Font font) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUI.GetAutoScaleSize (System.Drawing.Font
font) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form.GetAutoScaleSize (System.Drawing.Font
font) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form..ctor () [0x00000] in <filename unknown>:0
  at WindowsFormsApplicationMono1.Form1..ctor () [0x00000] in <filename
unknown>:0
  at (wrapper remoting-invoke-with-check)
WindowsFormsApplicationMono1.Form1:.ctor ()
  at WindowsFormsApplicationMono1.Program.Main () [0x00000] in <filename
unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.EntryPointNotFoundException:
GdipCreateFromXDrawable_linux
  at (wrapper managed-to-native)
System.Drawing.GDIPlus:GdipCreateFromXDrawable_linux (intptr,intptr,intptr&)
<snip>

So, I don't get it.  If I run "port installed", I can see gtk2 is
installed and active.  I can also see libgtk-2.0.dylib in
/opt/local/lib.  What does this code path within mono expect to find?
In what dir?  What GTK library file?  Is it really looking for some file
named "libgtk-x11-2.0.so.0?" on disk?

As always appreciate any suggestions.

Jeff

On 11/29/2012 11:26 AM, Rodrigo Kumpera wrote:
> Install X11 on your mac.
> 


More information about the Mono-list mailing list