Make winedump compilable by MSVC.
[wine.git] / documentation / HOWTO-winelib
blob62410996faf53d7e0fdc2e770b3cde5de533e9c5
1 WineLib HOWTO
2 Version 28-Dec-2000
4 AUTHOR: 
5 Wilbur Dale
6 Lumin Software BV
7 Zandheuvel 52 B
8 4901 HW Oosterhout (NB)
9 The Netherlands
11 wilbur.dale@lumin.nl
13 WARNING: This HOWTO is incomplete. I expect to add to it on a weekly
14 basis until it is complete.
16 =====================================================================
18 Table of Contents
20    I. Introduction: Wine vs. WineLib
22   II. Legal Issues
24  III. How Much Work?
26   IV. File Format Conversion
28    V. Compiling A Simple Win32 Program 
30   VI. Compiling A Win32 Program With Resources
32  VII. DLLs
33     A. Windows executable and Windows DLL.
34     B. Windows executable and WineLib DLL.
35     C. WineLib executable and Windows DLL.
36     D. WineLib executable and WineLib DLL.
38 VIII. How to use MFC
39     A. Using a native MFC DLL
40     B. Compiling MFC
42 VIII. Trademarks
43 Windows 3.x, Windows 95, Windows 98, Windows NT are trademarks of
44 Microsoft Corporation. 
46 Unix is a trademark of ???? FIXME: who has the trademark this week?
48 CrypKey is a trademark of Kenonic Controls Ltd.
50 FIXME: Codewright copyright ???
52 All other trademarks are the property of their respective owners.
54 =====================================================================
56 I. Introduction: Wine vs. WineLib
58 WineLib provides the Win32 API to a non-Microsoft operating
59 system. The WineLib Win32 functions use X11 functions to perform the
60 actual drawing on the screen. Wine and WineLib are based on the same
61 set of functions that implement the Win32 API. The difference between
62 Wine and WineLib is the type of executable that is loaded into memory
63 and executed. If an executable and any associated DLLs were compiled
64 for x86 hardware running the Windows 95, 98, or Windows NT (TM)
65 operating systems, then Wine can use a special binary loader to load
66 the program and the libraries into memory and execute it. WineLib on
67 the other hand allows you to take the source for such a program and
68 DLLs and compile it into the native format of a x86 Unix or Linux
69 operating system. WineLib also allows you to partially compile the
70 program and DLLs into the native format. For example, if you use a DLL
71 from a vendor to provide some functions to your program and the vendor
72 does not give you source, then you can use the Windows version of the
73 DLL to provide the functions and compile the rest of your program in
74 the native form for your system. [1]
76 Windows compilers and linkers generate executables with a different
77 structure than standard compilers. Windows has two executable formats:
78 the NE format and the PE format. The NE executable format provides for
79 two entry points and the PE format provides for three entry points
80 while a standard executable has a single entry point. Usually, a NE or
81 a PE executable will use one of the entry points for your program and
82 the other entry points will print an error message and exit. However,
83 a linker can link 16 bit objects into one or both of the alternate
84 entry points of a NE or PE executable.
86 Standard compilers assume that the function main() exists. The entry
87 point for a standard program is constructed from the C runtime
88 library, initialization code for static variables in your program, the
89 initialization code for your classes (C++), and your function main().
90 On the other hand, windows compilers assume WinMain() exists. The
91 entry point for a windows program is constructed from the C runtime
92 library, initialization code for static variables in your program, the
93 initialization code for your classes (C++), and your function
94 WinMain(). [4]
96 Since main() and WinMain() have different type signatures (parameter
97 types), WineLib provides certain aids to generate code so that your
98 program can be compiled and run as written for windows. For example,
99 WineLib generates a main() to initialize the windows API, to load any
100 necessary DLLs and then call your WinMain(). Therefore, you need to
101 learn four basic operations to compile a windows program using
102 WineLib: compiling a simple program, compiling resources, compiling
103 libraries, and compiling MFC (if you will be using MFC). Each of these
104 skills or operations are explained in later sections of this HOWTO.
106 Before you start porting your windows code to WineLib, you need to
107 consider whether you are allowed to port your program to WineLib. As
108 you compile your program using WineLib, you will be combining software
109 from several sources and you need to ensure that the licenses for the
110 components are compatible. Hence, in the next section, we will examine
111 several legal issues.
113 II. Legal Issues
115 Disclaimer! I am not a lawyer. The purpose of this section is to make
116 you aware of potential legal problems. Be sure to read your licenses
117 and to consult your attorney.
119 During the compilation of your program, you will be combining code
120 from several sources: your code, WineLib code, code from your vendor's
121 DLLs (if any), and Microsoft MFC code (if used). As a result, you must
122 ensure that the licenses of all code sources are obeyed. What you are
123 allowed and not allowed to do can vary depending on how you compile
124 your program and if you will be distributing it. For example, if you
125 are releasing your code under the GPL, you cannot link your code to
126 MFC code because the GPL requires that you provide ALL sources to your
127 users. The MFC license forbids you from distributing the MFC source so
128 you can not comply with the GPL license except by not distributing you
129 program. On the other hand, if your code is released under the LGPL,
130 you cannot statically link your program to MFC and distribute it, but
131 you can dynamically link your LGPL code and MFC code and distribute
134 Wine/WineLib is distributed under an X11-like license. It places few
135 restrictions on the use and distribution of Wine/WineLib code. I doubt
136 the Wine license will cause you any problems. On the other hand, MFC
137 is distributed under a very restrictive license and the restrictions
138 vary from version to version and between service packs.
140 If you plan on using MFC, there are three hurdles to legally using
141 MFC. The first hurdle is how to legally get MFC source code on your
142 computer. MFC source code comes as a part of Visual Studio. The
143 license for Visual Studio implies it is a single product that can not
144 be broken up into its components. The cleanest way to get MFC on your
145 system is to use a dual boot Linux box with the windows partition
146 visible to the Linux OS. Boot into windows and install Visual
147 Studio. Since Visual Studio is installed on the computer, you have not
148 broken it into its components. There may be other solutions, but I
149 think this is the easiest.
151 FIXME: quote relevant sections of EULA in above paragraph.
153 The second hurdle for MFC is the legality of compiling MFC on a
154 non-Microsoft operating system. This varies with the version of MFC.
156 MFC license from Visual Studio 6.0:
158     1.1 General License Grant. Microsoft grants to you as an
159     individual, a personal, nonexclusive license to make and use
160     copies of the SOFTWARE PRODUCT for the sole purposes of designing,
161     developing, and testing your software product(s) that are designed
162     to operate in conjunction with any Microsoft operating system
163     product. [Other unrelated stuff deleted.]
165 So it appears you cannot compile MFC for WineLib using this
166 license. On the other hand, Visual Studio 6.0 service pack 3 (Visual
167 Studio 5.0 is similar):
169     1.1 General License Grant. Microsoft grants to you as an
170     individual, a personal, nonexclusive license to make and use
171     copies of the SOFTWARE PRODUCT for the purpose of designing,
172     developing, and testing your software product(s). [Other unrelated
173     stuff deleted]
175 So it appears you can compile MFC for WineLib using this license.
177 The third hurdle is your legal right to distribute an MFC
178 library. Check the relevant section of the license on redistributables
179 and your redistribution rights. As I read the license, you only have
180 the right to distribute binaries of the MFC library if it has no debug
181 information and if you distribute it with an application that provides
182 significant added functionality to the MFC library.
184 FIXME: quote relevant sections of EULA in above paragraph.
186 Once you have examined the licenses for all of the sources used in
187 compiling your program and have decided you can legally compile you
188 program using WineLib, you should probably experiment with your
189 program running under Wine to determine how much work will be involved
190 in the port. The next section will give advice on estimating the
191 amount of work required for porting your program to WineLib.
193 III. How Much Work?
195 Wine and WineLib use the same functions to implement the windows API;
196 hence, if your program correctly runs under Wine, it should run under
197 WineLib. However, Wine/WineLib is incomplete; you may have trouble
198 running your program under Wine. Many people have successfully run many
199 programs under Wine, so there is a good chance you will have no
200 trouble.
202 Wine executes the binary program that was compiled for a windows
203 operating system. There are differences between the windows operating
204 system and Unix/Linux operating systems. For example, in Windows 95
205 and Windows 98, the program has direct access to the hardware. A copy
206 protection program that you purchased for your windows executable may
207 use direct hardware access to write data to the disk. Hence, you may
208 need to disable the copy protection in order to test your executable
209 under Wine.
211 As a specific example, CrypKey is a copy protection program we use at
212 Lumin Software. Our program does not execute under Wine with the copy
213 protection enabled. We disabled the copy protection, recompiled the
214 windows executable, and our program works fine. CrypKey also works for
215 Windows NT where it creates a service. Using Wine with the --winver
216 nt40 option "almost" gets the our program working with copy
217 protection. At a later date, we intend to either implement the system
218 calls in Wine that are missing for CrypKey or to use another copy
219 protection program that does work under Linux.
221 During the execution of your program, Wine prints error messages to
222 standard error. These error messages include "stubs", which are
223 windows API functions that have not been completely
224 implemented. Depending on the system call, these could be harmless
225 or crash your program. Most of the common windows API functions have
226 already been implemented, so you should have no missing API functions
227 or only a few missing functions. If you intend to continue with the
228 port to WineLib, you will need to implement these API
229 functions. After running your program for a while, you should have a
230 good feel for the number of windows API functions that you need to
231 implement. 
233 FIXME: give info on Wine command line options to control error
234 messages. 
236 During the compilation of Wine, you can control the amount of error
237 messages and debug information that will be be generated by Wine and
238 WineLib. For the version released to your customers, you may want to
239 use the following command line to configure the Wine/WineLib
240 libraries.
242 ./configure --disable-debug --disable-trace
244 The option --disable-debug compiles out all debugging messages and the
245 option --disable-trace compile out TRACE messages. [2] 
247 It is not necessary for you to implement the entire documented
248 behavior of an API function in order to get your program to work. For
249 example, many API functions have pointer parameters that are NULL in
250 the common cases. If you always call the function with a NULL pointer
251 for the default behavior, you can save yourself some effort by
252 implementing a function that only works for the NULL pointer
253 parameter. If you do this, make sure you test if the parameter is
254 non-null and issue a warning for the non-null case. Also document in
255 the source that the API function is incomplete.
257 FIXME: give info on the FIXME (macro/function?) for partially
258 implemented API functions.
260 Once you have implemented an API function, submit the change back to
261 the Wine project so the next person to need the same function does not
262 need to repeat your work. Remember, someone else wrote all of the
263 other API functions that you are using, so you are benefitting from
264 their work. Let other people benefit from your work as well. If you
265 work for a company, you may need your company's permission to "give
266 away" your work.
268 IV. File Format Conversion
270 Before you can compile your program, you must deal with one major
271 difference between Windows and WineLib. Window sources are in DOS
272 format with carriage return / line feed at the end of each line of
273 text while WineLib files are in Unix format with only line feed at the
274 end of each line of text. 
276 The main problem with the difference between Unix and DOS format
277 source files occurs with macro line continuation. A Unix compiler
278 expects a backslash (\) followed by a newline (^J) to indict that a
279 macro is continued on the next line. However, a file in DOS format will
280 have the characters backslash (\), carriage return (^M), and newline
281 (^J). The Unix compiler will interpret the backslash (\), carriage
282 return (^M), newline (^) of a file in DOS format as a quoted carriage
283 return and newline. The Unix compiler will think the line has ended
284 and the macro is completely defined. Hence, before you compile your
285 sources, you will need to convert you DOS format sources to Unix
286 format. There are several tools such as dos2unix and tr that are
287 available to convert the format.
289 FIXME: get more info on dos2unix, tr, and all other such tools and
290 give example commands. Until I do [3] is a good source.
292 FIXME: is CR/LF conversion necessary for gcc 2.95 ?
294 V. Compiling A Simple Win32 Program 
296 Wine and WineLib are written in C as is the MS Win32 API; thus, if
297 have a program that calls only the Win32 API directly, you can compile
298 the program using a C compiler and link it with some of the WineLib
299 libraries. There are several simple examples of WineLib programs in
300 the directory libtest/ in the Wine source tree. We shall examine one
301 of these to show you how to compile a WineLib program.
303 The example we shall examine is hello2. If you examine hello2.c, you
304 will see it is a windows program that pops up a message box that says
305 "Hello, hello!". It can be compiled and run using a windows compiler
306 just like any other windows program. However, it can not be compiled
307 and run with a non-windows compiler. As mentioned previously, windows
308 programs have an entry point called WinMain(), while non-windows
309 compilers use an entry point of main(). Hence, we need some "glue" to
310 glue the main() entry point to the WinMain() in the windows program.
312 In WineLib, some of the glue is provided by the spec file. Spec files
313 are used in several places in Wine and WineLib to provide glue between
314 windows code and code for non-windows compilers. WineLib provides a
315 tool called winebuild in the tools/winebuild directory that converts a
316 spec file into a C file that can be compiled and linked with the
317 windows source files. If you examine hello2.spec, you will see the
318 following:
320 name    hello2
321 mode    guiexe
322 type    win32
324 import  user32.dll
325 import  kernel32.dll
326 import  ntdll.dll
328 Information on the complete format of the spec file can be found in
329 <wine>/tools/winebuild/README. Name is the name of the
330 application. Mode is the type of "glue" that winebuild needs to
331 create. Possible modes are 'dll' for a library, 'cuiexe' for a console
332 application, and 'guiexe' for a regular graphical application. Type is
333 the type of API, either win32 or win16. Win16 is supported only in
334 Wine, not WineLib, so you should use win32. Import is a dll that must
335 be loaded for the program to execute.
337 During compilation of the hello2 executable, the following command is
338 executed. 
340 LD_LIBRARY_PATH="..:$LD_LIBRARY_PATH" \
341     ../tools/winebuild/winebuild -fPIC -L ../dlls -sym hello2.o \
342     -o hello2.spec.c -spec hello2.spec
344 The program winebuild will generate the output file hello2.spec.c (option
345 -o hello2.spec.c) from the spec file hello2.spec (option -spec
346 hello2.spec). The option -fPIC specifies that winebuild should generate
347 position independent code and is only necessary for building shared
348 library files (.so files). It is not needed when building the main
349 executable spec file, but since there is no assembly code generated
350 for the main executable, it doesn't make any difference anyway. [5]
352 The winebuild program is used in several places in Wine as well as
353 WineLib; however, only the -spec option will be used in WineLib. The
354 output file hello2.spec.c contains the glue code to initialize WineLib
355 and call WinMain().
357 In order to run hello2, we will compile the code into a shared library
358 (hello2.so) and create a symbolic link (hello2) with the wine
359 executable with the following steps.
361 gcc -c -I. -I. -I../include -I../include -g -O2 -Wall -fPIC -DSTRICT \
362     -D_REENTRANT -I/usr/X11R6/include -o hello2.o hello2.c
364 to compile the windows program itself and 
366 gcc -c -I. -I. -I../include -I../include -g -O2 -Wall -fPIC -DSTRICT \
367     -D_REENTRANT -I/usr/X11R6/include -o hello2.spec.o hello2.spec.c
369 to compile the spec file and the glue code. Finally,
371 gcc -shared  -Wl,-rpath,/usr/local/lib -Wl,-Bsymbolic -o hello2.so \
372     hello2.o hello2.spec.o -L.. -lwine -lncurses -lm  -lutil -ldl
374 links the compiled files into a shared library.
376 FIXME: -D_REENTRANT why?
377 FIXME: explain compiler options
378 FIXME: explain linker options
380 All of the steps are automated with the makefile, so "make hello2.so"
381 will execute all of the steps for you.  A final step is "make hello2",
382 which creates a symbolic link from hello2 to the wine executable. Now,
383 when "./hello2" is run, the wine executable sees it was called by the
384 name "hello2" and loads the shared library "hello2.so" and executes
385 the program.
387 THE INFO BELOW IS OUT OF DATE (28-Dec-2000)
389 Thus, you now have the basics of compiling a simple windows
390 program. There are two more things to learn for compiling more complex
391 windows programs: windows resources and DLL dependencies. Window
392 resources are described in the next section. DLL dependencies are
393 handled by linker magic with windows compilers. Thus, in WineLib, you
394 will need to provide information about which DLLs your program
395 depends. This information is given in the spec file. For example, if
396 our hello2 program had a .wav file that it played, it would need the
397 multi-media DLL winmm. Our spec file would then be
399 name    hello2
400 mode    guiexe
401 type    win32
402 init    WinMain
403 import  winmm
405 If you need to list multiple DLLs, then the import specification can
406 appear multiple times, one line per imported DLL.
408 VI. Compiling A Win32 Program With Resources
410 FIXME: to be continued.
411 Describe wrc.
412 Go through hello world example 3.
414 VII. DLLs
416 As mentioned in the introduction, Wine allows you to execute windows
417 executables and windows libraries under non-Microsoft operating
418 systems. WineLib allows you to take sources intended for the windows
419 operating system and to compile them to run as native executables
420 under a Unix/Linux operating system. With an executable and a single
421 library, there are four combinations in which to run the programs and
422 the library:
423     1. a Windows executable with a Windows DLL,
424     2. a Windows executable with WineLib DLL,
425     3. a WineLib executable with Windows DLL, and
426     4. a WineLib executable with WineLib DLL.
427 In this section, we will discuss each of these and discuss the steps
428 required to implement the executable/DLL combination. 
430 A. Windows executable and Windows DLL
432 Running a windows executable with a windows DLL is not a WineLib
433 program: it is a Wine program. If you type
434     wine program.exe
435 and the DLL is in the search path, then the windows program should run
436 using the windows DLL.
438 FIXME: find out what is the search path.
440 B. Windows executable and WineLib DLL
442 Running a windows executable with a WineLib DLL is also accomplished
443 using the Wine program. The source code for the DLL is compiled into a
444 Unix style shared library. When the windows executable "loads" the
445 DLL, Wine will use the shared library (.so file) instead.
447 At first you may wonder why you would want to run a windows executable
448 with a WineLib DLL. Such a situation implies you do not have the
449 source for the executable, but you do have the source for the
450 DLL. This is backwards from what you might expect. However, I do have
451 an example where this situation might arise.
453 Codewright is a popular editor in the windows world, and the
454 capabilities of Codewright can be extended by using DLLs. Since
455 Codewright is a commercial product, you do not have the source and
456 must use the windows executable with Wine. If you have written a DLL
457 to add functionality to Codewright, you have two choices: you can
458 compile the DLL using a windows compiler and use both a windows
459 executable and a windows DLL as in case A above, or you can use
460 WineLib and compile the DLL as a shared library (.so file). I have no
461 idea if Codewright actually runs under Wine, but this is an example of
462 why you might decide to use a windows executable and a WineLib
463 DLL. Many other editors and other programs use DLLs to extend their
464 functionality.
466 In order for Wine to use the WineLib DLL, certain glue code is need to
467 replace the linker magic that windows compilers use. As with a simple
468 executable, the winebuild program uses a spec file to generate the glue
469 code. For example, in the spec file for the DLL will look something like
470     name        winedll
471     type        win32
472     init        winedll_DllMain
473     1 cdecl _WINEbirthDay@4 ( str ) WINEbirthDay
474     2 cdecl _WINEfullName@4 ( str ) WINEfullName
475 The name is the name of the DLL. Since WineLib only supports win32,
476 the type should always be win32. The init function is the name of the
477 initialization function for the DLL. The initialization function for a
478 windows DLL is named DllMain(). You will need to rename the function
479 in the DLL source so there will not be any name clashes with the
480 DllMain() of other DLLs in you program.
482 The last two lines of the spec file above, provide the export
483 information for the DLL. For example, the line
484     1 cdecl _WINEbirthDay@4 ( str ) WINEbirthDay
485 says that the function at ordinal 1 uses the cdecl calling convention
486 for the parameters. The DLL export name is _WINEbirthDay@4. The
487 function takes a single parameter that is a string. Finally, the C
488 function name to be called whenever this DLL function is called is
489 WINEbirthday. You will need a function ordinal line for each function
490 in the DLL. The export name and the ordinal can be obtained from the
491 windows program dumpbin and the windows version of the DLL. See the
492 file <wine>/tools/winebuild/README for more details on the spec file
493 format.
495 During the compile process, a command like
496     winebuild -fPIC -o winedll.spec.c -spec winedll.spec
497 will be executed to create the file winedll.spec.c from information in
498 the file winedll.spec. The file winedll.spec.c and winedll.c are
499 compiled into object files and used to create the shared library.
501 In order for the program to run, a copy of the shared library must be in
502 your EXTRA_LD_LIBRARY_PATH. For example, if your wine.conf file has
503 the following line,
504     EXTRA_LD_LIBRARY_PATH=${HOME}/wine/lib
505 then you must copy the shared library into the directory ~/wine/lib/
506 and the shared library will now be in the correct search path.
508 Now when you type 
509     wine program.exe
510 the program will load the shared library (.so).
512 C. WineLib executable and Windows DLL
514 Running a WineLib executable with a Windows DLL is accomplished
515 using WineLib. This situation will be common since you may have
516 purchased DLLs to use with you project and the DLL vendor may not give
517 you the source code for the DLL.
519 In order for WineLib to use the Windows DLL, certain glue code is
520 needed to replace the linker magic that windows compilers use. Part of
521 the glue code must be written by you. The basic idea of the glue code
522 is that you write a new DLL that consists of function pointers. Each
523 function in the DLL will consist of a call on a function pointer. For
524 example, 
525     WINEDLL_ConstString WINEDLL_INTERFACE 
526     WINEfullName( WINEDLL_ConstString handle ) {
527         return (* pWINEfullName) ( handle );
528     }
529 The initialization function for the DLL will use the function
530 LoadLibrary() to load the windows DLL and initialize the function
531 pointers using the function GetProcAddress(). 
533 Since Wine can use either windows DLLs or Unix shared libraries (.so),
534 the LoadLibrary() function call may have unexpected results if there
535 is a winedll.dll and a winedll.so file. Hence, the windows version of
536 the DLL should be named something like hiddenWinedll.dll and the
537 shared library should be named winedll.so. Now the shared library will
538 use LoadLibrary() to load the "hidden" DLL.
540 The shared library will need a spec file. Fortunately, it is simpler
541 than case B above. The spec file will look something like
542     name        winedll
543     type        win32
544     init        winedll_DllMain
545 The name is the name of the DLL. Since WineLib only supports win32,
546 the type should always be win32. The init function is the name of the
547 initialization function for the shared library. This is the function
548 that will load the "hidden" DLL and initialize the function
549 pointers. There is no need for any function ordinals unless your
550 program calls functions by the ordinal.
552 During the compile process, a command like
553     winebuild -fPIC -o winedll.spec.c -spec winedll.spec
554 will be executed to create the file winedll.spec.c from information in
555 the file winedll.spec. The file winedll.spec.c and winedll.c are
556 compiled into object files and used to create the shared library.
558 Now that the shared library is compiled, you still need to compile
559 your program. Part of the compile process for your program will
560 consist of a spec file for your program. For example,
561     name        program
562     mode        guiexe
563     type        win32
564     init        WinMain
565     import winedll.dll
566 This spec file is similar to the spec file of the simple WineLib
567 example in part V above. The only difference is the import
568 specification that tells WineLib that the main program uses
569 winedll.dll. If this import line is not included, the "hidden" DLL
570 will not be loaded and the function pointers will not be initialized.
572 During the compile process, a command like
573     winebuild -fPIC -o program.spec.c -spec program.spec
574 will be executed to create the file program.spec.c from information in
575 the file program.spec. The file program.spec.c and your source code are
576 compiled into object files and used to create the executable.
578 D. WineLib executable and WineLib DLL.
580 Running a WineLib executable with a WineLib DLL is accomplished using
581 WineLib. The source for the DLL will be combined with a spec file to
582 generate the shared library. Likewise, the source for your program and
583 a spec file will be combined to create the executable. In the source
584 for the DLL, you should change the name of DllMain() to a name like
585 winedll_DllMain() so that there will not be a name clash with other
586 initialization functions for other DLLs.
588 The shared library's spec file is like case C above. The spec file
589 will look something like
590     name        winedll
591     type        win32
592     init        winedll_DllMain
593 The init function is the name of the initialization function for the
594 shared library (what you renamed DllMain to). There is no need for any
595 function ordinals unless your program calls functions by the ordinal.
597 During the compile process, a command like
598     winebuild -fPIC -o winedll.spec.c -spec winedll.spec
599 will be executed to create the file winedll.spec.c from information in
600 the file winedll.spec. The file winedll.spec.c and the source code for
601 your DLL are compiled into object files and used to create the shared
602 library.
604 Compiling your program is exactly like case C above. For example, the
605 spec file for you program will look something like
606     name        program
607     mode        guiexe
608     type        win32
609     init        WinMain
610     import winedll.dll
612 During the compile process, a command like
613     winebuild -fPIC -o program.spec.c -spec program.spec
614 will be executed to create the file program.spec.c from information in
615 the file program.spec. The file program.spec.c and your source code are
616 compiled into object files and used to create the executable.
618 VIII. How to use MFC
619     A. Using a native MFC DLL
620     B. Compiling MFC
622 FIXME: to be continued.
624 =====================================================================
625 References
627 Until this HOWTO is complete, I will document who gives me what
628 information. 
630 Reference [1] 
631 From: Patrik Stridvall <ps@leissner.se>
632 To: "'wilbur.dale@lumin.nl'" <wilbur.dale@lumin.nl>,
633 Date:   Mon, 5 Jun 2000 14:25:22 +0200 
635 First of all WineLib suppport for Win16 has been discontinued
636 for quite some time, because:
638 1. It is difficult for us to support and it is impossible
639    to do so perfectly without special compiler support,
640    because of memory layout issues. For example Win16 int
641    is 16-bit and data is aligned 16-bit.
642 2. It is in almost all cases easier to port a
643    Win16 application to Win32.
645 A minor detail, I personally would prefer that Wine and WineLib
646 was always used in the uppercase W and uppercase L variant,
647 instead of, as in your document, sometime one variant, sometimes
648 another.
650 Reference [2] 
652 The exact options for controlling error messages mentioned in the
653 reference are apparently incorrect, but may have been correct for some
654 earlier version of Wine.
656 From: michael cardenas <mbc@deneba.com>
657 To: wilbur.dale@lumin.nl
658 Date:   Mon, 5 Jun 2000 13:19:34 -0400
660 a few things you should mention...
662 - you can compile resources as a dll under windows and then load the dll
663 with wine. That's what we do for canvas. This is probably not ideal, but
664 most of my problems porting were in the code. We very seldomly have to
665 change the resources for the porting process. But wrc does work for most
666 cases...
668 - the error messages can be turned off or turned up with options to
669 configure like --enable-trace-msgs=wireoff or --enable-trace-msgs=wireon .
670 Take a look at configure.
672 - you probably want to compile your WineLib with --disable-debugger, at
673 least for the release version of your app.
675 Reference [3] 
676 http://fgouget.free.fr/wine/winelib-en.shtml
678 Reference [4]
679 Date: Wed, 21 Jun 2000 10:34:10 +0200
680 From: Rob Carriere <rob.carriere@lumin.nl>
681 To: Wilbur N Dale <wilbur.dale@lumin.nl>
682 Subject: WineLib-HOWTO comments
684 Hello Wilbur,
686 Some picking of nits.  It reads right well.
688 Some of Windows xyz are registered trade marks, other are vanilla:
689 Microsoft: Registered
690 Windows NT: Registered
691 Windows (95,98): plain
693 A Windows compiler does NOT generate a fake main.  Instead, the
694 executable file format provides for 2 (NE) or 3 (PE) entry points.
695 One of these is your program, the other(s) are normally filled with
696 stubs that print an error message and exit.  It is possible to instruct
697 the _linker_ to link 16-bit objects into one or both of the alternate
698 entry points, and create a fat binary.
700 At the C/C++ level, your statement about WinMain() is correct.  Of
701 course the actual entry point first inits run time lib etc, and then
702 calls the C/C++ level entry, but that is also true for main() in the
703 standard setup.  It may be important to regurgitate this info here,
704 though, because some of the fun things that can happen with multiple
705 run time libs and DLLs occur at this level.
707 Line 86: I only need to know how compile MFC if I use it... :-)
710 Best regards,
711  Rob                          mailto:rob.carriere@lumin.nl
713 Reference [5]
714 To: wilbur.dale@lumin.nl
715 Subject: Re: tool/build questions
716 From: Alexandre Julliard <julliard@winehq.com>
717 Date:   13 Jun 2000 20:06:23 -0700
719 "Wilbur N. Dale" <wilbur.dale@lumin.nl> writes:
721 > 2. tools/build for WineLib users -- is there ever a need to not specify -pic?
723 -pic is only necessary for building .so files, so it's not needed when
724 building the main executable spec file (but since there is no assembly
725 code generated for the main exe it doesn't make any difference anyway).
727 -- 
728 Alexandre Julliard
729 julliard@winehq.com
731 Reference [6]
732 Wine Weekly News #51 (2000 Week 28)
734 Events, progress, and happenings in the Wine community for 
735 July 10, 2000. 
737 Uwe Bonnes and Ove Kaven also reminded of some tools to generate under
738    Linux some Windows executables:
739      * Cygwin/Mingw: as native Linux apps
740      * LCC-Win32: run with the help of Wine
741      * Borland C++ 5.5: command line version available for free (after
742        registering to Borland users' database)
743        
744 =====================================================================
746 The information included here is from various Wine-devel posting and
747 private e-mails. I am including them so that any one starting on MFC
748 will have some documentation. Glean what you can and good luck.
750 Before I write more detailed info on compiling MFC I have three
751 questions. The info I have mentions three problems:
753     1. Wine header files---what is the status of this? Do changes need
754     to be made in the headers and if so, do I submit the changes back
755     into Wine cvs? Do the changes need #ifdef for C vs. C++
756     compilation? 
758     Francois Gouget <fgouget@psn.net> has been doing a lot of work in
759     this area. It should be a lot easier to compile using C++ now and to
760     compile MFC.
762     2. DOS format files <CR/LF> and no case distinction in
763     filenames. Do the extensions Corel made to gcc 2.95 handle this?
764     If so, how?
766     3. Microsoft extensions to the C++ syntax. Do the extensions Corel
767     made to gcc 2.95 handle this? If so, how?
769 If you have info that needs to be added, send me email at
770 <wilbur.dale@lumin.nl> and I will add it.
772 =====================================================================
774 THANKS
776 Most of the information in this file came from postings on
777 <Wine-devel@Winehq.com> and from private e-mails. The following people
778 contributed information for this document and I thank them for their
779 time and effort in answering my questions. I also want to thank them
780 for encouraging me to attack the MFC problem. 
782 CONTRIBUTERS:
784     Damyan Ognyanoff <Damyan@rocketmail.com>
785     Gavriel State <gav@magmacom.com>
786     Ian Schmidt <ischmidt@cfl.rr.com>
787     Jeremy White <jwhite@codeweavers.com>
790 From: Ian Schmidt <ischmidt@cfl.rr.com>
791 Subject: Re: WineLib and MFC
793 "Wilbur N. Dale" wrote:
795 > What is the status of MFC under WineLib?
797 I don't know precisely. Corel has done more MFC work than anyone (all
798 of their applications which they are porting are MFC-based), and
799 reportedly they have MFC itself compiled. I was just trying to get a
800 moderately simple MFC-using app to compile, with moderate success
801 (there are still some problems with MFC's headers after my patch, but
802 at least they don't appear to be Wine's fault :) I did not try to
803 compile MFC itself.
805 > Which versions of MFC, if any?
807 I have no idea what version Corel uses. As noted in my patch, I was
808 fiddling with the headers for MFC 6 (from Visual C++ 6.0 Service Pack
809 3). Most of the stuff my patch addressed was for newer IE 5-related
810 features, so I'd guess MFC 5 (VC++ 5.0) is likely what they used.
812 > Is there any documentation on how to compile MFC for WineLib?  If so
813 > where?
815 Not that I know of.
817 > I have started to compile programs using WineLib (hello.c last
818 > Sunday) and expect to be ready to start compiling MFC in a couple of
819 > weeks. If documentation is not available on compiling MFC, I am
820 > willing to write it.
822 Documentation would be a Good Thing, as WineLib in general is grossly
823 underdocumented right now. Here's a few tips I discovered to get you
824 started:
826 - First off, run all the MFC headers (and source too if you try it)
827 through a utility to strip out the DOS carriage returns. They cause
828 havoc with GCC when it sees one after a line that ends with a \ (and
829 MFC has many macros in it's headers that meet that description). If
830 you don't have one, do a Google search on "fromdos" and you should
831 locate some source (or it's fairly easy to make your own).
833 - Use GCC 2.95.2, and the -fpermissive flag to make it less picky.
834 2.95.2 has some VC++-compatibility features that Corel paid for, and I
835 believe more are forthcoming in future GCCs.
837 - Use -I to add whereever you have the MFC headers at to your include
838 path, as MFC apps typically use #include <> to access them rather than
841 - Be prepared to have to rename and/or symlink headers, unless you
842 compile on a case-insensitive filesystem :)
844 - When you make install Wine it seems not to include all it's headers
845 in /usr/local/include/Wine. To have any chance at getting MFC going
846 you'll want to use -I to add the include/ directory from the Wine
847 source tarball to the path so it can grab everything.
849 Sorry I can't help you more, but good luck!
851 -Ian Schmidt
852 ischmidt@cfl.rr.com
855 From: Jeremy White <jwhite@codeweavers.com>
856 Subject: Re: RFC: Wine 1.0
858 "Wilbur N. Dale" wrote:
859 > > Further, we have successfully built MFC after making only
860 > > a modest set of changes to it, even with older
861 > > versions of g++.
863 > Lumin Software is about to use WineLib to port a window program to linux. A
864 > couple of years ago we thought we had to make a modification to MFC for one
865 > of our projects and we had problems getting MFC to compile under MS Visual C++.
866 > After much wailing and gnashing of teeth, we gave up and did things another
867 > way. After this bad experience, we were wondering --- approximately how many
868 > man-hours did you spend compiling and changing MFC ?
870     Urk. I misspoke. None of the developers here that I thought
871 had working versions of MFC with Wine have working versions any
872 longer. So, it may be a bit trickier than I led you to believe.
874     We have it working pretty reliably with TWine, but not 
875 quite so cleanly (yet) with Wine. However, it really shouldn't
876 be too difficult, and this is what I can remember of the process:
878         1. If you use a very modern version of gcc (2.95.2 or higher),
879             I believe you will need to add the -relaxed flag to
880             have any hope of compiling.
882         2. If you use an earlier version of gcc, you will need to
883             adjust the many anonymous structs/unions that MFC supplies.
884             We prefer this approach, because requiring very
885             modern gcc implementations seems harsh to us.
887         3. You will need to adjust for the many type differences
888             between MFC intrinsic types and the types supplied by Wine.
889             For example, I believe that MFC expects a HANDLE to
890             be compatible with certain scalar types, (and it is
891             under Windows/VC, but is not with Wine/gcc).
893         4. The key procedure:  add many -DNO_XXX flags to the
894             makefile. If you start with Microsofts make file
895             for MFC, convert it into a Wine makefile, and then turn
896             on many of the flags they list there (of the form -DNO_XXX),
897             your life will get much easier. Once you get it working
898             with a few -DNO_XXX flags, you can go back and add them
899             back in.
901         5. The best resource:  you need someone who knows C++ very,
902             very well. You occassionaly run into very obscure C++
903             problems where MS has extended the C++ standard and
904             gcc has not. It really helps to have a guru on hand
905             when you hit those.
908 I hope this helps. Sorry for the earlier deceptive post.
910 Jeremy
912 From: Gavriel State <gav@magmacom.com>
913 Subject: Re: MFC questions
915 "Wilbur N. Dale" wrote:
917 > 1. Compile MFC. Several years ago we (Lumin Software) tried to
918 > compile MFC.  The attempt failed and we found another way to do what
919 > we wanted. MS documentation states that compiling MFC was
920 > deliberately made difficult.  Considering my experience with stuff
921 > they call "easy" I am not looking forward to compiling MFC. We are
922 > currently using Visual Studio 5 for windows development.
924 At Corel, we had MFC compiled and running sample apps in WineLib in
925 late 1998. It's mostly a question of the Wine headers, which weren't
926 originally up to snuff. We did quite a bit of work on them, and most
927 of those changes have been contributed back to WineHQ, so it should be
928 pretty easy now. The other thing that was a big deal was getting the
929 startup code working properly - since MFC needs to initialize static
930 data *after* WineLib gets initialized. I believe that that issue has
931 been addressed now on the WineHQ side with some of the work done on
932 the .spec file tools recently.
934 -Gav
936 -- 
937 Gavriel State
939 TransGaming Technologies Inc.
940 gav@transgaming.com
942 From: Jeremy White <jwhite@codeweavers.com>
943 Subject: Re: MFC questions
945 "Wilbur N. Dale" wrote:
946 [snip]
947 > 1. Compile MFC. Several years ago we (Lumin Software) tried to
948 > compile MFC.  The attempt failed and we found another way to do what
949 > we wanted. MS documentation states that compiling MFC was
950 > deliberately made difficult.  Considering my experience with stuff
951 > they call "easy" I am not looking forward to compiling MFC. We are
952 > currently using Visual Studio 5 for windows development.
954 Wilbur, I personally think that this is the 'right' approach, although
955 approach #2 may prove faster.
957 Despite your previous experience, and despite my earlier incorrect
958 statements, I think that this is simpler than you fear. It's one of
959 those tasks that's darkest before the storm - you spend all of your
960 energy getting all the include files to work. Once you have *one*
961 object file, the rest go much more quickly (alright, getting it to
962 link is also a hairball of a job, but it's tractable <g>).
964 If you're not in a hurry, getting MFC to compile, and having a
965 documented procedure for compiling it is on our agenda for the
966 relatively near future (see the Wine 1.0 task list).
970 p.s. Stick with Visi C++ 5. IMHO its MFC license is cleaner than that
971 of VC 6.
973 From: Gavriel State <gav@magmacom.com>
974 Subject: The MSVC++ 6.0 license
976 Jeremy White wrote:
977 > p.s. Stick with Visi C++ 5. IMHO its MFC license is cleaner than that
978 > of VC 6.
980 Actually, I just picked up a copy of MSVC 6.0 and it appears that they
981 changed the license between the original release and the Service Pack
982 3 release - they removed the bit in section 1.1 about requiring that
983 you be developing your software product only for use with a Microsoft
984 OS.  In any case, even the original license explicitly says that the
985 MFC redistribution rights are *in addition* to the usage rights in
986 section 1.1.
988 The relevant portion of the original EULA:
990  1.1    General License Grant. Microsoft grants to you as an individual, a
991  personal, nonexclusive license to make and use copies of the SOFTWARE 
992  PRODUCT for the sole purposes of designing, developing, and testing your
993  software product(s) that are designed to operate in conjunction with 
994  any Microsoft operating system product. [Other unrelated stuff deleted]
996 >From the SP3 EULA:
998  3.     Section 1.1 of the EULA is deleted in its entirety and replaced 
999  with the following:
1001  1.1    General License Grant. Microsoft grants to you as an individual, a 
1002  personal, nonexclusive license to make and use copies of the SOFTWARE 
1003  PRODUCT for the purpose of designing, developing, and testing your 
1004  software product(s). [Other unrelated stuff deleted]
1006 Disclaimer - I am not a lawyer, but I've spent lots of time with them 
1007 investigating software licenses.
1009  -Gav
1011 -- 
1012 Gavriel State
1014 TransGaming Technologies Inc.
1015 gav@transgaming.com
1017 From: Damyan Ognyanoff <Damyan@rocketmail.com>
1018 Subject: Need a hint
1022 I manage to build mfc42 as .so library and a application using it (as
1023 a .so library too). I execute it using simple loader which is linked
1024 to Wine and I load my application in it's WinMain routine. The
1025 problem is how clearly to unload mfc and my application (to invoke
1026 mfc's destructors before loader is terminated) All is fine except that
1027 there is a "zombi" reference to code in shared library which is
1028 invoked in Wine code and generate GPF. debugger stops somewhere in
1029 aplication's InitInstance !!! - and the stack is broken so I can't
1030 catch where exactly the problem is. Any hints are welcome. I'm using
1031 Wine-2000517 shapshot downloaded form Wine.datapary.no 
1033 TNX.
1035 Damyan
1036 p.s.
1037 If any of You is interested in details I can share my
1038 experience.
1040 WND comment:
1041     Francois Gouget <fgouget@psn.net> has been doing a lot of work in
1042     the  headers of wine. It should be a lot easier to compile using
1043     C++ now and to compile MFC. Many of the actions needed in the
1044     following email are not needed any more.
1046 From: Damyan Ognyanoff <Damyan@rocketmail.com>
1047 Subject: Re: Wine MFC info request
1050 my MFC is from VC6.0 with SP3
1051 MFC Bulid: (form  afxbld_.h)
1052     #define _MFC_BUILD 8447
1053     #define _MFC_USER_BUILD "8447"
1054     #define _MFC_RBLD 0
1055 mfcdll.rc
1056     FILEVERSION       6,0,_MFC_BUILD,_MFC_RBLD
1057     PRODUCTVERSION    6,0,0,0
1059 Hints:
1060     1. Wine include files
1062 In some of them you will find error about '__attribute__' all kinds of
1063 similar errors can be fixed using proper typedefs first example :
1065 typedef BOOL (CALLBACK *DLGPROC)(HWND,UINT,WPARAM,LPARAM);
1067 must be converted to
1069 typedef BOOL CALLBACK (*DLGPROC)(HWND,UINT,WPARAM,LPARAM);
1071 and the second kind is something like
1073 TYPE* WINAPI SomeFunction(HWND param1,UINT param2);
1075 The problem here is a TYPE* or TYPE& (in some of mfc files) the
1076 workaround is to declare a type before:
1078 typedef TYPE* TYPEPtr; 
1082 typedef TYPE& TYPERef;
1084 and declaration will look like:
1086 TYPEPtr WINAPI SomeFunction(HWND param1,UINT param2);
1088 note: don't miss a 'struct' when you define struct type pointers. I
1089 miss it and get a lot of problems compiling MFC:
1092 struct _TEB;
1093 typedef !!!struct!!! _TEB* P_TEB;
1094 extern inline P_TEB WINAPI NtCurrentTeb(void);
1097 Those conversions are semanticaly the same as above but g++ compile
1098 them and generate proper code to invoke __stdcall kind of functions
1100 in some of Wine/obj_XXX.h files: Wine/obj_base.h - there are a lot of
1101 defines's that are used to declare a COM interfaces
1103 #define ICOM_METHOD(ret,xfn) \
1104      public: virtual ret (CALLBACK xfn)(void) = 0;
1106 will be (for all of them that are related to C++ (watch #ifdef's
1107 carefully)):
1109 #define ICOM_METHOD(ret,xfn) \
1110      public: virtual ret CALLBACK (xfn)(void) = 0;
1112 and the second tip is an error when compiler stops on line like:
1114    ICOM_DEFINE(ISomeInterfase,IUnknown)
1116 watch method declarations above to find something like:
1118 ICOM_METHOD1(TYPE*,MethodName, DWORD,dwParam)
1120 and replace TYPE* with proper TYPEPtr type. In many cases You will see
1121 void* which can be replaced simply by LPVOID.
1123 qthere are several errors related to anonymous structs and unions but
1124 they can be avoided with proper - #ifdef __cplusplus
1126 This is all about Wine headers I think. If you find something that I
1127 miss type a line of mail to me.
1129 2. MFC
1130 The rules are the same with some new issues:
1132 virtual BOOL Method1(int param1, BOOL (CALLBACK *param2)
1133 (HWND,UINT,WPARAM,LPARAM));
1135 don't compile. I remove a function pointer declaration
1136 outside method:
1138 typedef BOOL CALLBACK
1139 (*param2Type)(HWND,UINT,WPARAM,LPARAM);
1141 virtual BOOL Method1(int param1, param2Type param2);
1143 I didn't apply this technique to a operator new
1144 definitions:
1146         void* AFXAPI operator new(size_t nSize);
1148 so i remove AFXAPI from these declarations:
1150 I got some missed #defines from commctrl.h and I added
1151 them form VC6.0 include.
1153 these are my defines form Makefile which I used to
1154 compile MFC
1156 -DTWINE_NO_CMONIKER \ -- this is related to exclude
1157 CMonikerFile 
1158 -D__urlmon_h__ \ -- Wine didn't have URL interfaces 
1159 -D_AFX_NO_OLEDB_SUPPORT \
1160 -D_WIN32  \
1161 -DNOWIN98  \ -- this is used to exclude all
1162 unimplemented classes from commctrl 
1163 -D_AFX_PACKING \
1164 -D_AFX_NO_DHTML_SUPPORT \
1165 -D_AFX_NO_SOCKET_SUPPORT \
1166 -D_AFX_NO_SYNC_SUPPORT \
1167 -D_AFX_NO_OCX_SUPPORT  \
1168 -D_AFX_PORTABLE \
1169 -D_AFX_OLD_EXCEPTIONS \
1170 -D_AFX_NO_SOCKET_SUPPORT \
1171 -D_AFX_NO_DEBUG_CRT \
1172 -D_AFX_NO_DAO_SUPPORT \
1173 -D_AFX_NO_OCC_SUPPORT \
1174 -D_AFX_NO_INET_SUPPORT \
1175 -D_AFX_NO_RICHEDIT_SUPPORT  \
1176 -D_X86_ \
1177 -DLONGHANDLES
1179 may be you will try to enable some of features of mfc I tested only
1180 -D_AFX_NO_OCC_SUPPORT but got missing interfaces from Wine
1182 in file afxcom_.h
1183 - _CIP<_Interface, _IID>::~_CIP<_Interface, _IID>()
1184 + _CIP<_Interface, _IID>::~_CIP()
1186 in file afxtempl.h
1187 -       BOOL Lookup(BASE_CLASS::BASE_ARG_KEY key,
1188 VALUE& rValue) const
1189 -               { return BASE_CLASS::Lookup(key,
1190 (BASE_CLASS::BASE_VALUE&)rValue); }
1191 +       BOOL Lookup(typename BASE_CLASS::BASE_ARG_KEY
1192 key, VALUE& rValue) const
1193 +               { return BASE_CLASS::Lookup(key,
1194 (typename BASE_CLASS::BASE_VALUE&)rValue); }
1196 and all releated errors can be fixed in this way.
1198 3. spec file
1199     name        mfc42
1200     type        win32
1201     rsrc        mfc42
1203     10 stdcall WinMain(long long ptr long) WinMain
1205 4. linking 
1206     use -rdynamic wnen link libmfc.so to get ARGV and
1207 ARGC from loader
1208     
1209 5. I didn'n build a extension dll with Wine but I suspect that there
1210 will be some problems related to a chaining Runtime classes form MFC
1211 to a new dll
1213 6. build your app as a MODULE too.
1215 7. make a loader and in it's _WinMain:
1216 ... includes are here
1217 iint PASCAL (*winMain)(HINSTANCE,HINSTANCE,LPSTR,int) =
1219 my app uses these to manage filenames
1220 VOID __cdecl (*_splitpath1)(LPCSTR path, LPSTR drive,
1221 LPSTR directory, LPSTR filename, LPSTR extension ) =
1222 NULL;
1223 VOID __cdecl _splitpath(LPCSTR path, LPSTR drive,
1224 LPSTR directory, LPSTR filename, LPSTR extension )
1226     if (_splitpath1)
1227         _splitpath1(path, drive, directory, filename,
1228 extension );
1230 VOID __cdecl (*_makepath1)(LPSTR path, LPCSTR drive,
1231 LPCSTR directory, LPCSTR filename, LPCSTR extension )
1232 = NULL;
1233 VOID __cdecl _makepath(LPSTR path, LPCSTR drive,
1234 LPCSTR directory, LPCSTR filename, LPCSTR extension )
1236     if (_makepath1)
1237         _makepath1(path, drive, directory, filename,
1238 extension);
1240 int PASCAL _WinMain(HINSTANCE h,HINSTANCE h1,LPSTR
1241 lpszCmdParam,int c)
1243   HINSTANCE hInstance,hins,hlib,htst,hform,himag,hexe;
1244         int retv;
1246         hins = LoadLibrary("CRTDLL.DLL");
1247         _splitpath1 = GetProcAddress(hins,
1248 "_splitpath");
1249         _makepath1 = GetProcAddress(hins,
1250 "_makepath");
1251         hins = LoadLibrary("COMCTL32.DLL");
1252         hins = LoadLibrary("COMDLG32.DLL");
1255         hins = dlopen("libmfc42.so",2);
1256         hlib = LoadLibrary("mfc42");
1257         himag = dlopen("libmxformatslib.so",2);
1258         hform = LoadLibrary("mxformatslib");
1259         hexe = dlopen("libmxpaint.so",2);
1260         htst = LoadLibrary("mxpaint");
1262         winMain = GetProcAddress(hlib, "WinMain");
1263         if (winMain)
1264         {
1265           retv = winMain (htst,    // note the > htst
1266 < HERE
1267                   0,            
1268                   lpszCmdParam, 
1269                   SW_NORMAL);   
1270         }
1271     FreeLibrary(htst);
1272     FreeLibrary(hform);
1273     FreeLibrary(hlib);
1274     dlclose(hexe);
1275     dlclose(himag);
1276     dlclose(hins);
1277     return retv;
1279 the spec for loader is:
1280 name    c10
1281 mode    guiexe
1282 type    win32
1283 init    _WinMain
1285 please find attached a Makefile which i use to build
1288 Regards 
1289 Damyan.
1291  LocalWords:  WineLib HOWTO Jul vs DLLs DLL MFC NT FIXME CrypKey Kenonic API TM
1292  LocalWords:  Codewright NE PE WinMain GPL LGPL EULA nonexclusive winver nt dos
1293  LocalWords:  redistributables unix tr CR LF gcc libtest winebuild pic fPIC dll
1294  LocalWords:  guiexe init cuiexe lwine lncurses lm lutil ldl wav winmm wrc lcc
1295  LocalWords:  dllExamples WindowsExeWindowsDLL WindowsExeWineDLL WineExeWineDLL
1296  LocalWords:  WineExeWindowsDLL Borland URL's cd distclean DllMain winemain exe
1297  LocalWords:  winedll cdecl WINEbirthDay str WINEfullName WINEbirthday libtool
1298  LocalWords:  proost conf LD libwinedll Gouget docs dumpbin ConstString Lumin
1299  LocalWords:  pWINEfullName LoadLibrary GetProcAddress hiddenWinedll BV HW dlls
1300  LocalWords:  Zandheuvel Oosterhout linkers executables runtime ntdll sym Wl
1301  LocalWords:  DSTRICT REENTRANT rpath Bsymbolic makefile multi