[Mono-list] SWF & Winelib Q&A
Peter Dennis Bartok
peter@novonyx.com
Fri, 19 Mar 2004 15:53:59 -0700
Search your disk for libgdiplus.so and make sure you don't have
duplicates. The libgdiplus that is being loaded by mono does not contain
a particular function which usually points to an older library being
used, despite the newer one also being installed.
If you have 'locate' on your system try 'locate libgdiplus' and post the
results. That'll show us if you've got various versions of it installed.
Peter
Pedro Santos wrote:
> Hey! What about my question? :P Can someone help me? I have installed
> everything again and still I ave the same problem compiling a simple SWF
> application:
>
> bash-2.05b$ mono h.exe
>
> When you are running with a native NT directory specify
> 'Profile=<profiledirectory>' or disable loading of Windows
> registry (LoadWindowsRegistryFiles=N)
>
> Unhandled Exception: System.EntryPointNotFoundException:
> GdipCreateFontFamilyFromName
> in <0x00053> (wrapper managed-to-native)
> System.Drawing.GDIPlus:GdipCreateFontFamilyFromName
> (string,intptr,intptr&)
> in <0x0007c> System.Drawing.FontFamily:.ctor
> (string,System.Drawing.Text.FontCollection)
> in <0x00012> System.Drawing.FontFamily:.ctor (string)
> in <0x00056> (wrapper remoting-invoke-with-check)
> System.Drawing.FontFamily:.ctor (string)
> in <0x0005b> System.Drawing.Font:.ctor
> (string,single,System.Drawing.FontStyle,System.Drawing.GraphicsUnit,byte,bool)
> in <0x00028> System.Drawing.Font:.ctor
> (string,single,System.Drawing.FontStyle)
> in <0x00083> (wrapper remoting-invoke-with-check)
> System.Drawing.Font:.ctor (string,single,System.Drawing.FontStyle)
> in <0x00039> System.Drawing.Font:FromHfont (intptr)
> in <0x00018> System.Windows.Forms.Control:get_DefaultFont ()
> in <0x00055> System.Windows.Forms.Control:get_Font ()
> in <0x0002d> System.Windows.Forms.Control:OnHandleCreated
> (System.EventArgs)
> in <0x00026> System.Windows.Forms.Form:OnHandleCreated
> (System.EventArgs)
> in <0x0025a> System.Windows.Forms.Control:CreateHandle ()
> in <0x0000a> System.Windows.Forms.Form:CreateHandle ()
> in <0x00033> System.Windows.Forms.Control:CreateControl ()
> in <0x0004f> (wrapper remoting-invoke-with-check)
> System.Windows.Forms.Control:CreateControl ()
> in <0x00015> System.Windows.Forms.Application:Run
> (System.Windows.Forms.Form)
> in <0x00024>
> Microsoft.Samples.WinForms.Cs.SimpleHelloWorld.SimpleHelloWorld:Main
> (string[])
>
>
> On Fri, 2004-03-19 at 21:02, Peter Dennis Bartok wrote:
>
>>Hi All,
>>
>>I figured since there are quite a few questions regarding winelib that
>>I'd write a little blurb on how things are connected. I tried to start
>>it in FAQ form to allow later inclusion into the FAQ.
>>Let me know if it helps, if you have additional questions or if you
>>notice something wrong/missing.
>>
>>1. What dependencies does System.Windows.Forms (SWF) have?
>>2. When running a SWF application I get the
>>System.DllNotFoundException:winelib.exe.so exception. What's wrong?
>>3. How can I verify that I've got winelib installed correctly?
>>4. When trying to run a SWF application I get the
>>System.DllNotFoundException:user32.dll exception. What's wrong?
>>5. When running a SWF application I don't get the usual nice exception
>>with stack and everything. What happened?
>>6. How does winelib work?
>>7. Why do I have to do those links from wine to the lib directory?
>>
>>
>>1. What dependencies does System.Windows.Forms (SWF) have?
>>The following is the dependency tree:
>>-> System.Windows.Forms
>> -> Winelib
>> -> Wine
>> -> System.Drawing
>> -> gdiplus
>> -> cairo
>> -> pixman
>> -> freetype
>> -> Xrender
>>
>>Unless you have *all* of these libraries working on your system, SWF
>>will not operate (and in most cases even initialize).
>>
>>
>>2. When running a SWF application I get the
>>System.DllNotFoundException:winelib.exe.so exception. What's wrong?
>>Several possible causes:
>>- The winelib package is not installed
>>- Winelib is installed but wine is not
>>- winelib.exe.so is not in <prefix>/lib
>>
>>
>>3. How can I verify that I've got winelib installed correctly?
>>Winelib will be installed into the <prefix>/lib directory. <prefix> was
>>chosen when the install packages was created. If you want to have
>>winelib in another directory than the default where it was installed to,
>>you must get the source packages and configure & compile it for a
>>different path.
>>
>>
>>4. When trying to run a SWF application I get the
>>System.DllNotFoundException:user32.dll exception. What's wrong?
>>
>>In order for SWF and winelib to operate properly you need to have
>>symbolic links for the wine dlls in the <prefix>/lib directory. While
>>the rpm should install those automatically as part of the postinstall
>>script you can also manually create those with the following command:
>>
>>cd <prefix>/lib
>>for i in <wine_dll_dir>/*dll.so; do ln -s $i lib`basename $i`; done
>>
>><prefix> is the base directory where mono is installed under (ie. /usr
>>or /usr/local) and <wine_dll_dir> is the directory where the wine dlls
>>(user32.dll.so, gdi32.dll.so, etc) can be found (ie. /usr/lib/wine or
>>/usr/local/lib/wine)
>>
>>5. When running a SWF application I don't get the usual nice exception
>>with stack and everything. What happened?
>>This is a known issue, when initializing wine the mono exception handler
>>is replaced with the wine exception handler. This will be fixed shortly.
>>
>>
>>6. How does winelib work?
>>
>>Winelib performs the same wine initialization as the command-line 'wine'
>>application. As 'argument' it uses itself, effectively telling wine to
>>rune winelib.exe.so. Before initializing, wine does a setjmp and when
>>wine calls the winelib.exe.so WinMain function we perform a longjmp
>>back to right after the wine initialization code was called. This
>>results in wine being initialized and control being back at the routine
>>that got called from SWF.
>>
>>
>>7. Why do I have to do those links from wine to the lib directory?
>>
>>Currently mono is not using the LD_LIBRARY_PATH to find libraries, and
>>also, mono has a particular naming format it expects libraries to have,
>>all libraries have to start with 'lib', and the wine dlls don't conform.
>>The symbolic links remedy this issue.
>>
>>
>>
>>
>>
>>_______________________________________________
>>Mono-list maillist - Mono-list@lists.ximian.com
>>http://lists.ximian.com/mailman/listinfo/mono-list