[Mono-osx] Redistributable Mac OSX app without mono using mkbundle2

Alexander Shulgin alexander.shulgin at yessoftware.com
Fri May 14 09:01:04 EDT 2010

On 14.05.2010 15:21, dgdw wrote:
> Alexander Shulgin-2 wrote:
>> The libgdiplus is loaded at runtime by System.Drawing assembly.  So,
>> you'll need to ship that with your app too.  To do so you'll need to
>> adjust it's deps (and for libjpeg, libpng, etc. too) with
>> install_name_tool like you've already did for mono libraries.
>> Btw, there should be no need to do that for the mono libs: just use
>> --static option of mkbundle (but beware of LGPL restrictions).
>> The version of libgdiplus shipped with mono depends on X11, so your
>> users still need to install that from Mac OS installation disc.
>> --
>> Best of luck!
>> Alex
> Hi Alex,
> Thanks for your quick response!
> The --static is not really an option for me due to the LGPL license, I want
> to keep my application distributed under the BSD license.
> I previously tried moving libgdiplus (and all its dependecies i.e.
> libgdiplus.0.dylib, libtiff.3.dylib etc) and then adjusting their
> dependencies like it did with the other libraries, however I found my
> application exits with the same error. On reflection I think this was to be
> expected, as I have not adjusted my main executable to reference libgdiplus
> in my package rather than the one distributed with mono. I am not sure how
> to do this because otool indicates that my executable does not depend on
> libgdiplus. Do I need to add an entry to my executable with
> install_name_tool? I am not sure what I need to do here....

As I already noted, libgdiplus is loaded at runtime with DllImport by 
System.Drawing, so adding/changing dependencies in your main module 
won't do the trick.

I recall, gdiplus.dll is mapped to 
through System.Drawing.dll.config.  I'd try removing the <dllmap> entry 
in that file before running mkbundle and see if that helps.


More information about the Mono-osx mailing list