Mono on OSX: Couldn't find gtksharpglue-2.dll

The solution how to run GTK Sharp MONO apps (compiled for example with Xamarin Studio) is to do following:

  1. Compile your mono/gtk-sharp app as Release

  2. Create shell script file (bash) like this (name it anyway you wish)

    [sharp]!/bin/sh
    
    export DYLD_FALLBACK_LIBRARY_PATH="/Library/Frameworks/Mono.framework/Versions/Current/lib:$DYLD_FALLBACK_LIBRARY_PATH:/usr/lib"    
    exec /Library/Frameworks/Mono.framework/Versions/Current/bin/mono ./AsketicExcel.exe
    

enter image description here

_3. Then you could run this form Terminal or you can use this packager tool http://sveinbjorn.org/platypus and create normal OSX App :) (include in the package all your files in Release dir)

Then in order to run this app on other mac you will need to install GTK# & Mono runtime http://www.go-mono.com/mono-downloads/download.html

In the end it would look like: enter image description here


I have found the issue, my dllmap was incomplete.

I added the following lines to /Library/Frameworks/Mono.framework/Versions/2.10.9/etc/mono/config:

<dllmap os="osx" dll="libgtk-win32-2.0-0.dll" target="/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/libgtk-quartz-2.0.0.dylib" />
<dllmap os="osx" dll="glibsharpglue-2" target="/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/libglibsharpglue-2.so" />
<dllmap os="osx" dll="libgthread-2.0-0" target="/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/libgthread-2.0.0.dylib" />
<dllmap os="osx" dll="libgthread-2.0-0.dll" target="/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/libgthread-2.0.0.dylib" />
<dllmap os="osx" dll="libglib-2.0-0.dll" target="/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/libglib-2.0.0.dylib" />
<dllmap os="osx" dll="libgobject-2.0-0.dll" target="/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/libgobject-2.0.0.dylib" />

Tags:

C#

Gtk

Macos

Mono