[Mono-osx] System.DllNotFoundException ... libgdiplus.dylib

Tamas Szekeres szekerest at gmail.com
Sun Sep 2 15:07:22 EDT 2007


Hi All,

I've tried to run my application on OSX and got the following error:

Unhandled Exception: System.TypeInitializationException: An exception
was thrown by the type initializer for System.Drawing.GDIPlus --->
System.DllNotFoundException:
/Library/Frameworks/Mono.framework/Versions/1.1.16.1/lib/libgdiplus.dylib
  at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup
(ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
  at System.Drawing.GDIPlus..cctor () [0x00000] --- End of inner
exception stack trace ---

  at <0x00000> <unknown method>
  at System.Drawing.Image.InitFromStream (System.IO.Stream stream) [0x00000]
  at System.Drawing.Image.InitFromStream (System.IO.Stream stream) [0x00000]
  at System.Drawing.Bitmap..ctor (System.IO.Stream stream, Boolean
useIcm) [0x00000]
  at System.Drawing.Bitmap..ctor (System.IO.Stream stream) [0x00000]
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor
(System.IO.Stream)
  at System.Drawing.Image.FromStream (System.IO.Stream stream) [0x00000]
  at GetBytes.Main (System.String[] args) [0x00000]


I have libgdiplus installed and libgdiplus.dylib exists in that
directory the error message refers to.

I've already tried to set DYLD_LIBRARY_PATH accordingly but that
didn't solve the problem.

According to http://www.mono-project.com/Problem:GDIPlusInit
here is the output of the otool command:

otool -L /Library/Frameworks/Mono.framework/Versions/1.1.16.1/lib/libgdiplus.dylib
/Library/Frameworks/Mono.framework/Versions/1.1.16.1/lib/libgdiplus.dylib:
        /Library/Frameworks/Mono.framework/Versions/1.1.16.1/lib/libgdiplus.0.0.0.dylib
(compatibility version 1.0.0, current version 1.0.0)
        /usr/X11R6/lib/libXrender.1.dylib (compatibility version
1.2.0, current version 1.2.0)
        /usr/X11R6/lib/libXext.6.dylib (compatibility version 6.4.0,
current version 6.4.0)
        /usr/X11R6/lib/libX11.6.dylib (compatibility version 6.2.0,
current version 6.2.0)
        /Library/Frameworks/Mono.framework/Versions/1.1.16.1/lib/libglib-2.0.0.600.3.dylib
(compatibility version 601.0.0, current version 601.3.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 88.1.5)
        /Library/Frameworks/Mono.framework/Versions/1.1.16.1/lib/libintl.3.4.0.dylib
(compatibility version 8.0.0, current version 8.0.0)
        /usr/lib/libiconv.2.dylib (compatibility version 5.0.0,
current version 5.0.0)
        /usr/X11R6/lib/libfontconfig.1.dylib (compatibility version
1.0.0, current version 1.0.0)
        /Library/Frameworks/Mono.framework/Versions/1.1.16.1/lib/libexpat.0.5.0.dylib
(compatibility version 6.0.0, current version 6.0.0)
        /Library/Frameworks/Mono.framework/Versions/1.1.16.1/lib/libfreetype.6.3.8.dylib
(compatibility version 10.0.0, current version 10.8.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current
version 1.2.3)
        /Library/Frameworks/Mono.framework/Versions/1.1.16.1/lib/libtiff.3.7.1.dylib
(compatibility version 11.0.0, current version 11.1.0)
        /Library/Frameworks/Mono.framework/Versions/1.1.16.1/lib/libjpeg.62.dylib
(compatibility version 63.0.0, current version 63.0.0)
        /Library/Frameworks/Mono.framework/Versions/1.1.16.1/lib/libungif.4.1.3.dylib
(compatibility version 6.0.0, current version 6.3.0)
        /usr/X11R6/lib/libSM.6.dylib (compatibility version 6.0.0,
current version 6.0.0)
        /usr/X11R6/lib/libICE.6.dylib (compatibility version 6.3.0,
current version 6.3.0)
        /Library/Frameworks/Mono.framework/Versions/1.1.16.1/lib/libpng12.0.0.0.dylib
(compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current
version 47.1.0)


Could anyone help me out with this problem?

Best regards,

Tamas Szekeres


More information about the Mono-osx mailing list