README 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Since a WineLib application is a Windows application that is compiled under
  2. Unix/Linux as a shared library it needs to be started differently than other
  3. applications. The WineLib application is started as any other Windows
  4. application running under Wine using the wine command. You cannot simply link
  5. in libwine (gcc myapp.c -lwine) to use Win32 functions.
  6. In order to use WineLib/Win32 functions under Mono I have created a small
  7. "stub" application that embeds the Mono engine inside the WineLib application.
  8. This is basically a replacement for the "mono" command that can be used
  9. to call the Win32 API (using WineLib) within an application written for Mono.
  10. To get started I suggest installing Wine and Mono first if they are not
  11. already installed. I am usually using the latest Wine snapshots built from
  12. source and installed under /usr/local. Also be sure to build/use a version of
  13. Mono with garbage collection disabled as there is a problem using WineLib with
  14. garbage collection enabled (check the mono-list archives for this discussion).
  15. You can disable garbage collection when building mono by adding --with-gc=none
  16. to the configure command. In the mono directory I build mono as:
  17. ./configure --with-gc=none
  18. In the WINELib makefile you may have set these to the appropriate files and/or
  19. paths on your PC:
  20. X11R6_INCLUDE=/usr/X11R6/include
  21. WINE_INCLUDE=/usr/local/include/wine
  22. WINE_LIB=/usr/local/lib/wine
  23. LIBMONO=/usr/local/lib/libmono.a
  24. If you type make from the mcs/class/System.Windows.Forms/WINELib
  25. directory it should build:
  26. System.Windows.Forms.dll -
  27. The current (if largely incomplete) Windows Forms package.
  28. FormTest.exe, NativeWindowTest.exe, Test.exe -
  29. Test applications which link to and tests the System.Windows.Forms.dll
  30. monostub.exe.so -
  31. The WineLib application that starts the Mono/WineLib application. This
  32. small WineLib application embeds the Mono JIT engine allowing any Mono
  33. application running in it access to WineLib/Win32 function calls.
  34. Before starting any of the applications set the LD_LIBRARY_PATH to the
  35. current directory (so DllImport can find the monostub.exe.so library):
  36. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
  37. To start any of the applications you type (from the WINELib directory):
  38. wine monostub.exe.so mono-winelibapp.exe
  39. John Sohn
  40. [email protected]