[Mono-list] SWF & Winelib Q&A

Kevin Jones kjones@develop.com
Fri, 19 Mar 2004 23:46:21 +0000


Peter thanks for this.

After following the steps I still have the same problem. I get

Could not load winelib.exe.so
Unhandled Exception: System.TypeInitializationException: An exception
was thrown by the type initializer for System.Windows.Forms.Control --->
System.TypeInitializationException: An exception was thrown by the type
initializer for System.Windows.Forms.Win32 --->
System.DllNotFoundException: winelib.exe.so
in <0x00053> (wrapper managed-to-native)
System.Windows.Forms.Win32:WineLoadLibrary (string)
in <0x002e1> System.Windows.Forms.Win32:.cctor ()
--- End of inner exception stack trace ---
 
in (unmanaged) System.Windows.Forms.Win32:RegisterWindowMessage (string)
in <0x000f2> System.Windows.Forms.Control:.cctor ()
--- End of inner exception stack trace ---
 
in (unmanaged) System.Windows.Forms.Control:.ctor ()
in <0x0000f> System.Windows.Forms.ScrollableControl:.ctor ()
in <0x0000a> System.Windows.Forms.ContainerControl:.ctor ()
in <0x00017> System.Windows.Forms.Form:.ctor ()
in <0x0000a> MyFormProject.MainForm:.ctor ()
in <0x0004f> (wrapper remoting-invoke-with-check)
MyFormProject.MainForm:.ctor ()
in <0x0001b> MyFormProject.MainForm:Main (string[])


if winelib.exe.so is not in /usr/lib

If I copy it to that directory I get:

Could not stat /nt (No such file or directory), ignoring drive E:
Could not stat /home/kevinj/.wine/${HOME} (No such file or directory),
ignoring drive F:
Warning: could not find wine config [Drive x] entry for current working
directory /home/kevinj/temp/winforms; starting in windows directory.
Warning: L"/usr/local/lib/winelib.exe.so" not accessible from a
configured DOS drive
Warning: L"/usr/local/lib/winelib.exe.so" not accessible from a
configured DOS drive
wine: cannot find '/usr/local/lib/winelib.exe.so'

and yes it is in /usr/local/lib.

Any help would be appreciated.

THanks,



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
>