[Mono-winforms-list] System.DllNotFoundException: gdiplus.dll

Peter Dennis Bartok peter at novonyx.com
Tue Jan 24 14:48:29 EST 2006


You pretty much answered your own question. If you're loading a library, and 
that lib in turn depends on another that cannot be found, the original 
library will fail loading with a DllNotFoundException. The error clearly 
shows that it (the libgdiplus that's being loaded) wants a libtiff.so.3 
which you don't have. You can try finding the right version, or creating a 
symbolic link to a libtiff.so.3.

However, since you also have /usr/lib/libgdiplus your system is probably 
loading that version, not the one in your /opt/mono/bla... directory. I'd 
assume the linker searches it's cached paths before *falling back* to 
LD_LIBRARY_PATH. That would mean in your case you're using the wrong 
libgdiplus. See what happens when you run with the right version.


Cheers,
  Peter

-----Original Message-----
From: "Andrew Weaver" <andrew_weaver at sil.org>
To: <mono-winforms-list at lists.ximian.com>
Date: 24 January, 2006 12:32
Subject: [Mono-winforms-list] System.DllNotFoundException: gdiplus.dll


>Hello all!
>
>I'm experiencing some difficulty getting a very simple Windows.Forms
>application (built on Windows) to run on Ubuntu Linux (5.10). When I look 
>on
>the web, I see that others have had a similar problem. I've tried following
>the troubleshooting instructions posted at
>http://www.mono-project.com/DllNotFoundException, but have reached a dead
>end with my line of enquiry.
>
>Before I describe the troubleshooting steps I've taken, I should give a
>little background. I installed Ubuntu Breezy, followed by Mono 1.1.8 taken
>from the distribution's "universe" repository on my Apple laptop. I
>encountered some problems with Windows.Forms applications, so I decided to
>install a more up-to-date version of Mono, again on Ubuntu Breezy, but this
>time on my desktop PC. Preferring to use Synaptic Package Manager to 
>install
>the software, I found repository details at
>http://npw.net/2005/12/26/ubuntu-breezy-backports. With this version of 
>Mono
>(1.1.13.1), I experience the same problem as raised in the recent "Mono
>hangs after looking up XKeycodeToKeysym" thread. At this point I obtained
>the "Linux installer for x86" from the Mono downloads page and installed
>Mono 1.1.13.2 into /opt/mono.
>
>Now to the troubleshooting session:
>
>$ MONO_LOG_LEVEL=debug mono HelloWorld-Win.exe
><snip>
>Mono-INFO: DllImport attempting to load: 'gdiplus.dll'.
>Mono-INFO: DllImport loading location: 'libgdiplus.dll.so'.
>Mono-INFO: DllImport error loading library: 'libgdiplus.dll.so: cannot open
>shared object file: No such file or directory'.
>Mono-INFO: DllImport loading library: './libgdiplus.dll.so'.
>Mono-INFO: DllImport error loading library './libgdiplus.dll.so: cannot 
>open
>shared object file: No such file or directory'.
>Mono-INFO: DllImport loading: 'gdiplus.dll'.
>Mono-INFO: DllImport error loading library 'gdiplus.dll: cannot open shared
>object file: No such file or directory'.
>Mono-INFO: DllImport loading location: 'libgdiplus.so'.
>Mono-INFO: DllImport error loading library: 'libtiff.so.3: cannot open
>shared object file: No such file or directory'.
>Mono-INFO: DllImport loading library: './libgdiplus.so'.
>Mono-INFO: DllImport error loading library './libgdiplus.so: cannot open
>shared object file: No such file or directory'.
>Mono-INFO: DllImport loading: 'gdiplus'.
>Mono-INFO: DllImport error loading library 'gdiplus.so: cannot open shared
>object file: No such file or directory'.
>Mono-INFO: DllImport loading location: 'libgdiplus.dll'.
>Mono-INFO: DllImport error loading library: 'libgdiplus.dll: cannot open
>shared object file: No such file or directory'.
>Mono-INFO: DllImport loading library: './libgdiplus.dll'.
>Mono-INFO: DllImport error loading library './libgdiplus.dll: cannot open
>shared object file: No such file or directory'.
>Mono-INFO: DllImport loading: 'libgdiplus.dll'.
>Mono-INFO: DllImport error loading library 'libgdiplus.dll: cannot open
>shared object file: No such file or directory'.
>
>(HelloWorld-Win.exe:16639): Mono-WARNING **: DllImport unable to load
>library 'libgdiplus.dll: cannot open shared object file: No such file or
>directory'.
><snip>
>
>The troubleshooting instructions say that the directories specified by the
>$LD_LIBRARY_PATH environment variable will be searched. I elected to have
>the installer modify my ~/.bashrc file, so when I check my environment
>variables, I see:
>
>$ env | sort
><snip>
>LD_LIBRARY_PATH=/opt/mono/mono-1.1.13.2/lib:
><snip>
>
>Then, checking up on the dynamic linker, I get:
>
>$ ldconfig -p | grep libgdiplus
>        libgdiplus.so.0 (libc6) => /usr/lib/libgdiplus.so.0
>        libgdiplus.so (libc6) => /usr/lib/libgdiplus.so
>
>Although the troubleshooting instructions describe a procedure for forcing
>the dynamic linker cache to be rebuilt, the implication is that rebuilding
>the cache is merely a more elegant way of fixing the problem than setting
>the $LD_LIBRARY_PATH variable. Since that environment variable has already
>been set by the installer, will there be any benefit from rebuilding the
>cache?
>
>Note that /opt/mono/mono-1.1.13.2/lib contains both libgdiplus.so and
>libtiff.so.3.5 (but not libtiff.so.3). Is it the missing libtiff.so.3 
>that's
>the real problem?
>
>I ran the installer using sudo so that it was able to create the mono
>directory within /opt. Would I have done better to accept the default
>install location, in my home directory?
>
>Thanks for reading this far. Any help would be greatly appreciated.
>
>--Andrew
>
>
>_______________________________________________
>Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>
> 



More information about the Mono-winforms-list mailing list