[Mono-list] compiling / using libgdiplus on Mac OS X w/ mono

jeff clausius jeffc at sourcegear.com
Tue Dec 4 17:00:08 UTC 2012


In order to get around some issues of missing functions, I'm compiling
libgdiplus on Mac OS X Lion.  After cloning the libgdiplus repo from
git, I ran autogen.sh to generate the config files.

I ran into some issues regarding libpng being 1.5 on my system and
libgdiplus only working with libpng 1.4.  Found someone's patch and
compiled.  Also discovered CCFLAGS needed to be set to '-arch i386'
before running autogen.sh.

After all this, I was able to .configure/make a 32 bit version of
libgdiplus (libgdiplus.0.dylib).  After compilation, I copied the new
libgdiplus.0.dylib and libgdiplus.la to the Mono 3.0.1 Framework lib
directory (renaming the old ones), and also replaced the symlinks for
libgdiplus.dylib and libgdiplus.0.0.0.dylib.

Now, if I run a test app using MONO_MWF_MAC_FORCE_X11 with an embedded
resource, I get the following error:

Unhandled Exception:
System.ArgumentException: A null reference or invalid value was found
[GDI+ status: InvalidParameter]
  at System.Drawing.GDIPlus.CheckStatus (Status status) [0x00000] in
<filename unknown>:0
  at System.Drawing.Image.Clone () [0x00000] in <filename unknown>:0
  at System.Resources.RuntimeResourceSet.CloneDisposableObjectIfPossible
(System.Object value) [0x00000] in <filename unknown>:0
  at System.Resources.RuntimeResourceSet.GetObject (System.String name,
Boolean ignoreCase) [0x00000] in <filename unknown>:0
  at System.Resources.ResourceManager.GetObject (System.String name,
System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Resources.ResourceManager.GetObject (System.String name)
[0x00000] in <filename unknown>:0
  at App1.Form1.InitializeComponent () [0x00000] in <filename unknown>:0
  at App1.Form1..ctor () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) App1.Form1:.ctor ()
  at App1.Program.Main () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: A null
reference or invalid value was found [GDI+ status: InvalidParameter]
<snip>


Do you think I compiled libgdiplus incorrectly?  Did I copy / hookup
libgdiplus into the Mono Framework lib directory incorrectly?  Any idea
how to trouble shoot this issue?

All help will be appreciated.

Jeff


More information about the Mono-list mailing list