<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>70867</bug_id>
          
          <creation_ts>2004-11-11 14:23 0000</creation_ts>
          <short_desc>Error loading libgdiplus</short_desc>
          <delta_ts>2004-11-28 14:57:03 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Development</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://bugs.gentoo.org/show_bug.cgi?id=55916</bug_file_loc>
          
          
          <priority>P2</priority>
          <bug_severity>blocker</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>thomas.zoechling@gmx.at</reporter>
          <assigned_to>dotnet@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>thomas.zoechling@gmx.at</who>
            <bug_when>2004-11-11 14:23:25 0000</bug_when>
            <thetext>I emerged mono-1.0.4 and libgdiplus-1.0.4 and have problems with applications that use System.Drawing.
Exception:
System.DllNotFoundException: gdiplus.dll

This behavior is exactly the same as mentioned in a previous bug:
http://bugs.gentoo.org/show_bug.cgi?id=55916

Additional i tried to add the dll to /etc/mono/config: (I pointed it to libgdiplus.so)
&lt;configuration&gt;
        &lt;dllmap dll=&quot;cygwin1.dll&quot; target=&quot;libc.so.6&quot; /&gt;
        &lt;dllmap dll=&quot;libc&quot; target=&quot;libc.so.6&quot; /&gt;
        &lt;dllmap dll=&quot;libintl&quot; target=&quot;libc.so.6&quot; /&gt;
        &lt;dllmap dll=&quot;libxslt.dll&quot; target=&quot;libxslt.so&quot; /&gt;
        &lt;dllmap dll=&quot;libmySQL.dll&quot; target=&quot;libmysqlclient.so&quot; /&gt;
        &lt;dllmap dll=&quot;odbc32.dll&quot; target=&quot;libodbc.so&quot; /&gt;
        &lt;dllmap dll=&quot;oci&quot; target=&quot;clntsh&quot; /&gt;
        &lt;dllmap dll=&quot;db2cli&quot; target=&quot;libdb2_36.so&quot;/&gt;
!!     -&gt;&gt;&gt;&gt;&gt;   &lt;dllmap dll=&quot;gdiplus.dll&quot; target=&quot;libgdiplus.so&quot;/&gt;
&lt;/configuration&gt;




Reproducible: Always
Steps to Reproduce:
1.emerge mono 
2.create a simple program that uses system.drawing
3.start it

Actual Results:  
I got the following exception:
System.DllNotFoundException: gdiplus.dll

Expected Results:  
Find the dll.

Portage 2.0.50-r11 (default-x86-2004.2, gcc-3.3.4, glibc-2.3.3.20040420-r1, 2.6.
8-gentoo-r3)
=================================================================
System uname: 2.6.8-gentoo-r3 i686 AMD Athlon(tm) processor
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS=&quot;x86&quot;
AUTOCLEAN=&quot;yes&quot;
CFLAGS=&quot;-O2 -mcpu=i686 -pipe&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
COMPILER=&quot;&quot;
CONFIG_PROTECT=&quot;/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3
/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /us
r/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control&quot;
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-O2 -mcpu=i686 -pipe&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoaddcvs ccache sandbox&quot;
GENTOO_MIRRORS=&quot;http://gentoo.osuosl.org http://distro.ibiblio.org/pub/Linux/dis
tributions/gentoo&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;X alsa apache2 apm arts avi berkdb bitmap-fonts crypt cups dvd encode esd f
77 foomaticdb fortran gif gnome gpm gtk gtk2 gtkhtml imlib jpeg libg++ libwww ma
d mikmod motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib pe
rl png python quicktime readline sdl slang spell ssl svga tcpd truetype x86 xml2
 xmms xv zlib&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>latexer@gentoo.org</who>
            <bug_when>2004-11-12 09:50:38 0000</bug_when>
            <thetext>There doesn&apos;t need to be a libgdiplus.so.dll, this gets mapped by the runtime appropriately. Usually this actually means there was a problem loading the .so file. Can you try doing:

MONO_LOG_LEVEL=&quot;debug&quot; mono foo.exe

To get a more verbose output and post the relevant section concerning the loading of libgdiplus? Thanks.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>thomas.zoechling@gmx.at</who>
            <bug_when>2004-11-13 01:48:58 0000</bug_when>
            <thetext>The problem seems to be that mono searches a file libgdiplus.so.so in /lib/usr/lib

but i couldnt locate libgdiplus.so.so and the path /lib/usr/lib simply doesnt exist

Trace:

Mono-INFO: DllImport attempting to load: &apos;/usr/lib/libgdiplus.so&apos;.
Mono-INFO: DllImport loading location: &apos;lib/usr/lib/libgdiplus.so.so&apos;.
Mono-INFO: DllImport error loading library: &apos;lib/usr/lib/libgdiplus.so.so: cannot open shared object file: No such file or directory&apos;.
Mono-INFO: DllImport loading library: &apos;./lib/usr/lib/libgdiplus.so.so&apos;.
Mono-INFO: DllImport error loading library &apos;./lib/usr/lib/libgdiplus.so.so: cannot open shared object file: No such file or directory&apos;.
Mono-INFO: DllImport loading: &apos;/usr/lib/libgdiplus.so&apos;.
Mono-INFO: DllImport error loading library &apos;/usr/lib/libgdiplus.so: undefined symbol: XML_GetCurrentLineNumber&apos;.

(bmTest.exe:14146): Mono-WARNING **: DllImport unable to load library &apos;/usr/lib/libgdiplus.so: undefined symbol: XML_GetCurrentLineNumber&apos;.
Mono-INFO: DllImport attempting to load: &apos;/usr/lib/libgdiplus.so&apos;.
Mono-INFO: DllImport loading location: &apos;lib/usr/lib/libgdiplus.so.so&apos;.
Mono-INFO: DllImport error loading library: &apos;lib/usr/lib/libgdiplus.so.so: cannot open shared object file: No such file or directory&apos;.
Mono-INFO: DllImport loading library: &apos;./lib/usr/lib/libgdiplus.so.so&apos;.
Mono-INFO: DllImport error loading library &apos;./lib/usr/lib/libgdiplus.so.so: cannot open shared object file: No such file or directory&apos;.
Mono-INFO: DllImport loading: &apos;/usr/lib/libgdiplus.so&apos;.
Mono-INFO: DllImport error loading library &apos;/usr/lib/libgdiplus.so: undefined symbol: XML_GetCurrentLineNumber&apos;.

(bmTest.exe:14146): Mono-WARNING **: DllImport unable to load library &apos;/usr/lib/libgdiplus.so: undefined symbol: XML_GetCurrentLineNumber&apos;.
Mono-INFO: DllImport attempting to load: &apos;/usr/lib/libgdiplus.so&apos;.
Mono-INFO: DllImport loading location: &apos;lib/usr/lib/libgdiplus.so.so&apos;.
Mono-INFO: DllImport error loading library: &apos;lib/usr/lib/libgdiplus.so.so: cannot open shared object file: No such file or directory&apos;.
Mono-INFO: DllImport loading library: &apos;./lib/usr/lib/libgdiplus.so.so&apos;.
Mono-INFO: DllImport error loading library &apos;./lib/usr/lib/libgdiplus.so.so: cannot open shared object file: No such file or directory&apos;.
Mono-INFO: DllImport loading: &apos;/usr/lib/libgdiplus.so&apos;.
Mono-INFO: DllImport error loading library &apos;/usr/lib/libgdiplus.so: undefined symbol: XML_GetCurrentLineNumber&apos;.

(bmTest.exe:14146): Mono-WARNING **: DllImport unable to load library &apos;/usr/lib/libgdiplus.so: undefined symbol: XML_GetCurrentLineNumber&apos;.
Mono-INFO: DllImport attempting to load: &apos;/usr/lib/libgdiplus.so&apos;.
Mono-INFO: DllImport loading location: &apos;lib/usr/lib/libgdiplus.so.so&apos;.
Mono-INFO: DllImport error loading library: &apos;lib/usr/lib/libgdiplus.so.so: cannot open shared object file: No such file or directory&apos;.
Mono-INFO: DllImport loading library: &apos;./lib/usr/lib/libgdiplus.so.so&apos;.
Mono-INFO: DllImport error loading library &apos;./lib/usr/lib/libgdiplus.so.so: cannot open shared object file: No such file or directory&apos;.
Mono-INFO: DllImport loading: &apos;/usr/lib/libgdiplus.so&apos;.
Mono-INFO: DllImport error loading library &apos;/usr/lib/libgdiplus.so: undefined symbol: XML_GetCurrentLineNumber&apos;.

(bmTest.exe:14146): Mono-WARNING **: DllImport unable to load library &apos;/usr/lib/libgdiplus.so: undefined symbol: XML_GetCurrentLineNumber&apos;.

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---&gt; System.DllNotFoundException: gdiplus.dll
in &lt;0x00053&gt; (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&amp;,System.Drawing.GdiplusStartupInput&amp;,System.Drawing.GdiplusStartupOutput&amp;)
in &lt;0x00068&gt; System.Drawing.GDIPlus:.cctor ()
--- End of inner exception stack trace ---

in (unmanaged) System.Drawing.Bitmap:.ctor (int,int,System.Drawing.Imaging.PixelFormat)
in &lt;0x00059&gt; System.Drawing.Bitmap:.ctor (int,int,System.Drawing.Imaging.PixelFormat)
in &lt;0x00015&gt; System.Drawing.Bitmap:.ctor (int,int)
in &lt;0x00061&gt; (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor (int,int)
in &lt;0x00077&gt; ContactSheetGenerator:Main (string[])
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>latexer@gentoo.org</who>
            <bug_when>2004-11-13 05:17:22 0000</bug_when>
            <thetext>&lt;snip&gt;
Mono-INFO: DllImport error loading library &apos;/usr/lib/libgdiplus.so: undefined symbol: XML_GetCurrentLineNumber&apos;.
&lt;/snip&gt;

^ that&apos;s actually the problem. It&apos;s finding the file, but then having a problem resolving one of the symbols. Can you please post the output of &quot;ldd /usr/lib/libgdiplus.so&quot; for me? Also, what version of libtool do you have installed?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>thomas.zoechling@gmx.at</who>
            <bug_when>2004-11-13 07:25:17 0000</bug_when>
            <thetext>My libtool is: 1.5.2-r5

Where is cairo?
I thougt mono is using it for gdi+ things.(Wondered about that already when i emerged libgdiplus)

ldd /usr/lib/libgdiplus.so
linux-gate.so.1 =&gt;  (0xffffe000)
        libXrender.so.1 =&gt; /usr/X11R6/lib/libXrender.so.1 (0x4011f000)
        libX11.so.6 =&gt; /usr/X11R6/lib/libX11.so.6 (0x40127000)
        libXext.so.6 =&gt; /usr/X11R6/lib/libXext.so.6 (0x401ee000)
        libglib-2.0.so.0 =&gt; /usr/lib/libglib-2.0.so.0 (0x401fc000)
        libpng12.so.0 =&gt; /usr/lib/libpng12.so.0 (0x4027a000)
        libz.so.1 =&gt; /lib/libz.so.1 (0x402aa000)
        libm.so.6 =&gt; /lib/libm.so.6 (0x402bb000)
        libpthread.so.0 =&gt; /lib/libpthread.so.0 (0x402dd000)
        libc.so.6 =&gt; /lib/libc.so.6 (0x4032e000)
        libdl.so.2 =&gt; /lib/libdl.so.2 (0x4043e000)
        /lib/ld-linux.so.2 =&gt; /lib/ld-linux.so.2 (0x80000000)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>thomas.zoechling@gmx.at</who>
            <bug_when>2004-11-20 05:03:02 0000</bug_when>
            <thetext>I did it the hard way :)
I &quot;fixed&quot; it by pasting this to the 1.0.4 ebuild:
src_unpack() {
	unpack ${A}
	cd ${S}

	# See bug #55916
	einfo &quot;Fixing a libtool problem&quot;
	rm ltmain.sh
	aclocal
	libtoolize --force --copy
}

This is from the ebuild that fixed bug #55916

Then i created an overlay as described here:
http://gentoo-wiki.com/HOWTO_Installing_3rd_Party_Ebuilds
...and reemerged libgdiplus

after that my test apps work.
I hope this helps anyone.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>nzgreen@operamail.com</who>
            <bug_when>2004-11-28 01:34:48 0000</bug_when>
            <thetext>Looks like the patch from bug# 55916 was added to libgdiplus-1.0-r1, then was removed for libgdiplus-1.0.2 and libgdiplus-1.0.4.  As mentioned by Thomas, adding the src_unpack() function fixes the problem.  Can this please be added back in to portage tree?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>latexer@gentoo.org</who>
            <bug_when>2004-11-28 12:28:54 0000</bug_when>
            <thetext>Okay, re-openning so this doesn&apos;t get lost. I&apos;ll re-add that libtool fix as soon as I get back in front of my dev box.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>latexer@gentoo.org</who>
            <bug_when>2004-11-28 14:57:03 0000</bug_when>
            <thetext>Ok, i&apos;ve just commited 1.0.4-r1 which includes the same libtool fix from 1.0-r1. Marking FIXED.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>