Misc release-related mods
[wxWidgets.git] / docs / msw / install.txt
1
2 Installing wxWindows 2.3
3 ------------------------
4
5 This is wxWindows 2.3 for Microsoft Windows 3.1, 95, 98 and
6 Windows NT/Windows 2000. This is an unstable development release.
7
8 IMPORTANT NOTE: If you experience problems installing, please
9 re-read this instructions and other related files (changes.txt,
10 readme.txt, notes on the Web site) carefully before mailing
11 wx-users or the author. Preferably, try to fix the problem first and
12 then send a patch to the author. Please report bugs using the
13 bug report form on the wxWindows web site.
14
15 Unarchiving
16 -----------
17
18 A setup program is provided (setup.exe) to automatically copy files to a
19 directory on your hard disk. Do not install into a path that contains spaces.
20 The installation program should set the WXWIN environment variable, which
21 will be activated when your machine is rebooted. The setup
22 program contains the following:
23
24 - All common, generic and MSW-specific wxWindows source;
25 - samples;
26 - documentation in Windows Help format;
27 - makefiles for most Windows compilers, plus BC++ and
28   VC++ IDE files;
29 - JPEG library source;
30 - TIFF library source;
31 - Object Graphics Library;
32 - Tex2RTF source;
33 - Dialog Editor binary.
34
35 Alternatively, you may unarchive the .zip form by hand:
36 wxMSW-x.y.z.zip where x.y.z is the version number.
37
38 Unarchive the required files plus any optional documentation
39 files into a suitable directory such as c:\wx.
40
41 Other add-on packages are available from the wxWindows Web site, such as:
42
43 - mmedia.zip. Audio, CD, video access for Windows and Linux.
44 - ogl3.zip. Object Graphics Library: build network diagrams, CASE tools etc.
45 - tex2rtf3.zip. Tex2RTF: create Windows Help, HTML, and Word RTF files from
46   the same document source.
47
48 General installation notes
49 --------------------------
50
51 Alter your WXWIN environment variable to point to this directory.
52 For Cygwin or Mingw32 compilation, make sure WXWIN contains only
53 forward slashes.
54
55 If installing from the CVS server, copy include/wx/msw/setup0.h to
56 include/wx/msw/setup.h and edit the resulting file to choose the featrues you
57 would like to compile wxWindows with[out].
58
59 Compilation
60 -----------
61
62 The following sections explain how to compile wxWindows with each supported
63 compiler.
64
65 Visual C++ 4.0/5.0/6.0 compilation
66 ----------------------------------
67
68 Using project files (VC++ 5 and 6 only):
69
70 1. Unarchive wxWindows-x.y.z-vc.zip, the VC++ 5/6 project
71    makefiles (already included in wxMSW-x.y.z.zip and the setup version).
72 2. Open src/wxvc.dsp, set Debug or Release configuration for
73    the wxvc project, and compile. Alternatively, use Batch Build
74    to build both Debug and Release configurations.
75    This will produce lib/wx.lib (release) and lib/wxd.lib (debug),
76    plus various subordinate libraries. It assumes you have
77    the TIFF and JPEG source, which is already in the setup
78    version of the distribution.
79    The project file src/wxvc_dll.dsp will make a DLL version of wxWindow,
80    which will go in lib/wxdll.[lib,dll] and lib/wxdlld.[lib,dll].
81 3. Open a sample project file, choose a configuration such as
82    Debug using Build | Set Active Configuration..., and compile.
83    The project files don't use precompiled headers, to save disk
84    space, but you can switch PCH compiling on for greater speed.
85    NOTE: you may also use samples/SamplesVC.dsw to access all
86    sample projects without opening each workspace individually.
87    You can use the Batch Build facility to make several samples
88    at a time.
89
90 Using makefiles:
91
92 1. Make sure your WXWIN variable is set.
93 2. If you do NOT have the TIFF or JPEG source code, please remove
94    the tiff and jpeg targets from the 'all' target in
95    src\msw\makefile.vc. Also ensure the settings in
96    include\wx\msw\setup.h specify not to use JPEG or TIFF.
97 3. Change directory to wx\src\msw. Type:
98
99   'nmake -f makefile.vc'
100
101    to make the wxWindows core library with debug information
102    (wx\lib\wxd.lib), then
103
104   'nmake -f makefile.vc cleanall FINAL=1'
105   'nmake -f makefile.vc FINAL=1'
106
107    to make the wxWindows core library without debug information
108    (wx\lib\wx.lib).
109 4. Change directory to wx\samples and type 'nmake -f makefile.vc'
110    to make all the samples. You can also make them individually.
111
112 Makefile notes:
113
114   Use the 'cleanall' target to clean all objects, libraries and
115   executables.
116
117   To build the release version using makefiles, add FINAL=1 to your
118   nmake invocation, both when building the library and for samples.
119   You MUST use the 'cleanall' target (with FINAL=1 or FINAL=0)
120   before making a different configuration, because otherwise
121   object files used to build the previous configuration may be
122   used accidentally for the current configuation. You might see
123   this manifested in unexpected link errors or warnings. This problem
124   doesn't occur when using project files to build wxWindows.
125
126   Note that the wxWindows core library allows you to have debug
127   and release libraries available simultaneously, by compiling the
128   objects in different subdirectories, whereas samples must be
129   cleaned and re-made to build a different configuration.
130
131 To build the DLL version using makefiles:
132
133 1. Change directory to wx\src\msw. Type 'nmake -f makefile.vc dll pch'
134    to make both a suitable DLL and import library, and to build a
135    suitable precompiled header file for compiling applications.
136    The resulting libraries are called:
137
138       wx\lib\wx[version].lib(dll) (debug version)
139       wx\lib\wx[version].lib(dll) (release version, using FINAL=1)
140
141 2. Invoke a sample makefile with 'nmake -f makefile.vc WXUSINGDLL=1'
142    (or edit src\makeprog.vc to set WXUSINGDLL to 1 for all
143    applications).
144
145 Note (1): if you wish to use templates, please edit
146 include\wx\msw\setup.h and set wxUSE_DEBUG_NEW_ALWAYS to 0.
147 Without this, the redefinition of 'new' will cause problems in
148 the headers. Alternatively, #undef new before including template headers.
149 You will also need to set wxUSE_IOSTREAMH to 0 if you will be
150 using templates, to avoid the non-template stream files being included
151 within wxWindows.
152
153 Note (2): libraries and applications generated with makefiles and
154 project files are now (hopefully) compatible where static libraries
155 are concerned, but please exercise caution nevertheless and if
156 possible, use one method or the other.
157
158 Note (3): VC++ 5's optimization code seems to be broken and can
159 cause both compile and run-time problems: this can be seen when
160 deleting an object Dialog Editor, in Release mode with optimizations
161 on. If in doubt, switch off optimisations, although this will result in much
162 larger executables. It seems possible that the library can be created with
163 strong optimization, so long as the application is not strongly
164 optimized. For example, in wxWindows project, set to 'Minimum
165 Size'. In Dialog Editor project, set to 'Customize: Favor Small
166 Code' (and no others). This will then work.
167
168 Similarly, in VC++ 4, optimization can cause internal compiler
169 errors, so edit src\makevc.env and change /O1 to /Od before
170 trying build a release version of the library. Or, type:
171
172 nmake -f makefile.vc noopt FINAL=1
173
174 and then resume compilation in the normal way. This will build
175 troublesome files with no optimization. However, there now seems to be
176 an internal linker error using VC++ 4, in addition to internal
177 compiler errors for most of the samples, so this version of the compiler
178 cannot be recommended!
179
180 Note (4): some crash problems can be due to inconsistent compiler
181 options. If strange/weird/impossible things start to happen please
182 check (dumping IDE project file as makefile and doing text comparison
183 if necessary) that the project settings, especially the list of defined
184 symbols, struct packing, etc. are exactly the same for all items in
185 the project. After this, delete everything (including PCH) and recompile.
186
187 Note (5): for some further notes about upgrading your project
188 files to be compatible with wxWindows 2.1.14, please see
189 "Highlights of wxWindows" from the Download page of the
190 web site or CD-ROM.
191
192 Note (6): to create your own IDE files, see the technical note on the
193 wxWindows web site or CD-ROM, entitled "Compiling wxWindows
194 applications in the VC++ IDE" (technical note docs/tech/tn0010.htm in the
195 wxWindows distribution). You can also copy .dsp and .dsw
196 files from an existing wxWindows sample and adapt them.
197
198 Visual C++ 1.5 compilation (16-bit)
199 -----------------------------------
200
201 1. Make sure your WXWIN variable is set, and uses the FAT (short
202    name) form.
203 2. Change directory to wx\src\msw. Type 'nmake -f makefile.dos' to
204    make the wxWindows core library.
205 3. Change directory to a sample, such as wx\samples\minimal, and
206    type 'nmake -f makefile.dos'.
207
208 Add FINAL=1 to your makefile invocation to build the release
209 versions of the library and samples.
210
211 Use the 'clean' target to clean all objects, libraries and
212 executables.
213
214 Borland C++ 4.5/5.0 compilation
215 -------------------------------
216
217 Compiling using the makefiles:
218
219 1. Make sure your WXWIN variable is set, and uses the FAT (short
220    name) form if doing a 16-bit compile.
221 2. Change directory to wx\src\msw. Type 'make -f makefile.b32' to
222    make the wxWindows core library. Ignore the warnings about
223    'XXX' not found in library.
224 3. Change directory to a sample or demo such as samples\minimal, and type
225   'make -f makefile.b32'.
226 4. For release versions, recompile wxWindows and samples using
227    'make -f makefile.b32 clean'
228    'make -f makefile.b32 FINAL=1'
229    for the library and samples.
230 5. To make and use wxWindows as a DLL, type
231    'make -f makefile.b32 clean'
232    'make -f makefile.b32 DLL=1'
233    and then for each sample,
234    'make -f makefile.b32 WXUSINGDLL=1'
235    Please note that the samples have not been exhaustively tested
236    with this configuration.
237
238 Note (1): the wxWindows library and (some) samples compile in 16-bit mode
239 using makefile.bcc, but at present the wxWindows resource system is switched
240 off in this mode. See issues.txt for details.
241
242 Note (2): unfortunately most samples won't link in 16-bit mode,
243 because the automatic data segment exceeds 64K. The minimal
244 sample links and runs, however.
245
246 Note (3): the wxWindows makefiles assume byte structure alignment. Please
247 make sure that your own project or makefile settings use the
248 same alignment, or you could experience mysterious crashes. To
249 change the alignment, add a suitable option to the $(CFG) target code
250 in src/msw/makefile.b32.
251
252 Note (4): if you get undefined _SQL... symbols at link time,
253 either install odbc32.lib from the BC++ CD-ROM into your BC++ lib
254 directory, or set wxUSE_ODBC to 0 in include\wx\msw\setup.h and
255 recompile wxWindows. The same applies if compiling using the IDE.
256
257 Note (5): BC++ 4.5 (not 5.0) trips up over jdmerge.c in the JPEG folder;
258 you will therefore need to set wxUSE_LIBJPEG to 0 in setup.h and remove
259 the jpeg target from src\msw\makefile.b32, and remove jpeg from
260 src\makeprog.b32.
261
262 Note (6): If using C++Builder 4 and above (BC++ 5.4 and above), change LINK=tlink32 to
263 LINK=ilink32 in src\makeb32.env. You may also need to disable
264 wxUSE_LIBJPEG because there is a conflict in the BC++ headers
265 (actually this problem seems to have gone away with 5.5 and SP1).
266
267 Note (7): If you wish debug messages to be sent to the console in
268 debug mode, edit src\makeb32.env and change /aa to /Tpe in
269 LINK_FLAGS.
270
271 Compiling using the IDE files:
272
273 1. Load src\bc32.ide (Release settings)
274 2. Go to Options|Project... and specify the correct BC++ include and lib path for
275    your file structure.
276 3. Press F9 to compile the wxWindows library.
277 4. Load samples\bc32.ide.
278 5. Go to Options|Project... and specify the correct BC++ include and lib path for
279    your file structure.
280 6. Press F9 to compile the samples (build each node separately if
281    you prefer, by right clicking and choose Build Node).
282 7. Run each sample: you may need to run from each sample's directory
283    since some (notably the wxHTML samples) look for files
284    relative to the working directory.
285
286 Note (1): the samples project file contains a selection of
287 samples, and not all samples. The remaining samples can be made
288 with the makefiles. See also the demos hierarchy which doesn't
289 have any BC++ project files yet.
290
291 Note (2): to make the png, zlib, jpeg and tiff libraries (needed for
292 some samples) you need to compile them with bc32.ide.
293
294 Note (3): the debug version of the wxWindows library is about 40 MB, and the
295 release version is around 5 MB.
296
297 See also the file docs/tech/tn0007.txt for further instructions and details
298 of how to create your own project files.
299
300 Borland C++ 5.5 compilation
301 ---------------------------
302
303 Before compiling wxWindows with Borland C++ 5.5, there are a few 
304 issues concerning the compiler installation: 
305
306 1. The compiler must be installed to a path that does not contain 
307    spaces, such as c:\Borland\Bcc55 (in particular, do not install 
308    it below "C:\Program Files").
309
310 2. Make sure that you downloaded and installed the service pack 1 
311    for Borland C++ 5.5.  This SP1 can be downloaded from:
312    http://www.borland.com/devsupport/bcppbuilder/file_supplements.html
313
314    IMPORTANT:
315    When installing SP1, make sure that you extract (UnZip) the files 
316    to the directory where you installed Borland C++ 5.5 (e.g., 
317    c:\Borland\Bcc55) with the option "use folder names" selected. 
318    This is necessary, to ensure that the files (mostly include files) 
319    are extracted to the right directory.
320
321 3. Create the following two files in the same directory where you 
322    installed Borland C++ 5.5 (e.g., c:\Borland\Bcc55):
323
324    a. bcc32.cfg
325       text file containing the following two lines:
326       -I"c:\Borland\Bcc55\include"
327       -L"c:\Borland\Bcc55\lib"
328
329    b. ilink32.cfg
330       text file containing the following line:
331       -L"c:\Borland\Bcc55\lib"
332
333    (replace c:\Borland\Bcc55 with the actual path where you installed 
334    Borland C++ 5.5)
335
336 4. Add the borland BIN directory to your path (e.g., c:\Borland\Bcc55\bin), 
337    and define the environment variable BCCDIR=<Borland C++ 5.5 path>
338    (e.g., set BCCDIR=c:\Borland\Bcc55)
339
340 Compiling wxWindows:
341
342 Once the compiler and its service pack are properly installed, you build 
343 wxWindows using the provided makefile.b32 in the src/msw directory:
344
345 a. To build wxWindows in DEBUG mode:
346
347     cd c:\wx2\src\msw
348     make -f makefile.b32
349
350     (replace c:\wx2 with the actual path where you installed wxWindows)
351
352 b. To build wxWindows in RELEASE mode:
353
354     cd c:\wx2\src\msw
355     make -f makefile.b32 FINAL=1   
356
357     (if you had previously built wxWindows, you need to clean all of
358     the object and intermediate files.  Before the above make command, 
359     run: 'make -f makefile.b32 CLEANALL')
360
361 IMPORTANT:
362 The Service Pack 1 for Borland C++ 5.5 must be installed before wxWindows 
363 is compiled.  If you compiled wxWindows before, it is advised that you 
364 re-compile it following the next steps:
365
366     cd c:\wx2\src\msw
367     make -f makefile.b32 CLEANALL
368     make -f makefile.b32   (or make -f makefile.b32 FINAL=1)
369
370     (replace c:\wx2 with the actual path where you installed wxWindows)
371
372 ** REMEMBER **
373
374 In all of your wxWindows applications, your source code should include 
375 the following preprocessor directive:
376
377 #ifdef __BORLANDC__
378 #pragma hdrstop
379 #endif
380
381 (check the samples -- e.g., \wx2\samples\minimal\minimal.cpp -- for 
382 more details) 
383
384 Borland C++Builder compilation
385 ------------------------------
386
387 1. Build the wxWindows libraries using the Borland make utility as
388    specified in the section called "Borland C++ 4.5/5.0 compilation"
389    above. (C++ Builder includes a stand-alone C++ compiler.  For example,
390    C++ Builder 4.0 comes with C++ 5.4.)
391
392 2. You can build samples using the makefiles as per the
393    instructions for BC++ above, or you can follow the instructions
394    in docs/tech/tn0004.htm or http://biolpc22.york.ac.uk/wx/bc/ide.html.
395
396 Watcom C++ 10.6/11 compilation
397 ---------------------------
398
399 1. Make sure your WXWIN variable is set, and uses the DOS short
400    name form.
401 2. Change directory to wx\src\msw. Type 'wmake -f makefile.wat' to
402    make the wxWindows core library.
403 3. Change directory to wx\samples\minimal and type 'wmake -f makefile.wat'
404    to make this sample. Repeat for other samples of interest.
405
406 Note (1): makewat.env uses the odbc32.lib supplied in wxWindows' lib\watcom
407 directory. See the notes in that directory.
408 Note (2): if variant.cpp is compiled with date/time class
409 options, the linker gives up. So the date/time option is switched
410 off for Watcom C++. Also, wxAutomationObject is not compiled with
411 Watcom C++.
412 Note (3): if Watcom can't read the precompiled header when
413 building a sample, try deleting src\msw\watcom.pch and
414 compiling the sample again.
415
416 Metrowerks CodeWarrior compilation
417 ----------------------------------
418
419 1. Downloaded and unzip wxWindows-x.y.z-cw.zip.
420 2. Load the make_cw.mcp project in wx\src, and compile.
421 3. Load the make_cw.mcp project in wx\samples\minimal, and compile.
422    Further project files for samples will be available in due
423    course.
424
425 Note (1): you need CodeWarrior Pro 4 plus the patches to 4.1 from the
426 Metrowerks Web site.
427
428 Note (2): unfortunately these files are not yet up-to-date for the
429 current release.
430
431 Symantec C++ compilation
432 ------------------------
433
434 1. Make sure your WXWIN variable is set, and uses the FAT (short
435    name) form.
436 2. Edit setup.h and set wxUSE_DRAG_AND_DROP to 0.
437 3. Change directory to wx\src\msw. Type 'make -f makefile.sc' to
438    make the wxWindows core library.
439 4. Change directory to wx\samples\minimal and type 'make -f makefile.sc'
440    to make this sample.
441
442 Note: the minimal sample doesn't link properly ('Error: no
443 start address').
444 32-bit compilation only (partially) supported at present, using SC++ 6.1.
445 Some functionality is missing using this compiler (see makefile).
446 Add -D__WIN95__ if your SC++ has Windows 95 support, and ignore
447 Step (2). 16-bit compilation is left as an excercise for the user!
448
449 Salford C++ compilation
450 -----------------------
451
452 1. Make sure your WXWIN variable is set, and uses the FAT (short
453    name) form.
454 2. Edit SALFORDDIR and RESOURCEDIR in src/makesl.env as per
455    notes.
456 3. Change directory to wx\src\msw. Type 'mk32 -f makefile.sl all' to
457    make the wxWindows core library.
458 4. Change directory to wx\samples\minimal and type 'mk32 -f makefile.sl'
459    to make this sample.
460
461 Unfortunately, Salford C++ seems to have problems with its code generation for
462 operations on objects, as seen in wxFrame::OnMenuHighlight
463 (minimal sample) or wxWindow::SetValidator (mdi sample). Also the
464 the debugging version of the library is 90MB, with samples coming in
465 at 40MB :-) However, wxWindows at least makes a good test suite for
466 improving the compiler.
467
468 Cygwin/Mingw32 compilation
469 ----------------------------------
470
471 wxWindows 2 supports Cygwin (formerly GnuWin32) betas and
472 releases, and Mingw32.
473
474 Thanks are due to Keith Garry Boyce (garp@opustel.com), Cygnus
475 and others for making it all possible.
476
477 Both Cygwin and Mingw32 (the minimal distribution of Cygwin) can be used
478 with the same makefiles.
479
480 Here are the steps required:
481
482 - Retrieve and install the latest beta of Cygwin, or Mingw32, as per the
483   instructions with either of these packages.
484
485 - If using Mingw32, you need some extra files to use the wxWindows
486   makefiles. You can find these files in ports/mingw32 on the
487   wxWindows ftp site or CD-ROM, as extra.zip. These should be extracted
488   to the Mingw32 directory. If you have alread downloaded rm, cp, mv
489   from elsewhere, you won't need this.
490
491   If using Mingw32 2.95 and below with wxWindows 2.1 or above, you
492   must hand-patch with Mingw32-gcc295.patches (located in the
493   top-level of the wxWindows 2 installation). Mingw32 2.95.2
494   and above contain the fixes already.
495
496 - Modify the file wx/src/cygnus.bat (or mingw32.bat or mingegcs.bat)
497   to set up appropriate variables, if necessary mounting drives.
498   Run it before compiling.
499
500 - For Cygwin, make sure there's a \tmp directory on your
501   Windows drive or bison will crash (actually you don't need
502   bison for ordinary wxWindows compilation: a pre-generated .c file is
503   supplied).
504
505 - Edit wx/src/makeg95.env and set the MINGW32 variable at the top of
506   the file to either 1 (you have Mingw32 or Cygwin 1.x releases) or 0
507   (if you have Cygwin betas). If using Mingw32, also set the
508   MINGW32VERSION variable appropriately.
509
510 - Set your WXWIN variable to where wxWindows is installed.
511   *** IMPORTANT: For Cygwin/Mingw32, use forward slashes in the path, not
512   backslashes.
513
514 - Use the makefile.g95 files for compiling wxWindows and samples,
515   e.g.:
516   > cd c:\wx\src\msw
517   > make -f makefile.g95
518   > cd c:\wx\samples\minimal
519   > make -f makefile.g95
520
521   Ignore the warning about the default entry point.
522
523 - Use the 'strip' command to reduce executable size.
524
525 - With Cygwin, you can invoke gdb --nw myfile.exe to
526   debug an executable. If there are memory leaks, they will be
527   flagged when the program quits.
528
529 - If using GnuWin32 b18, you will need to copy windres.exe
530   from e.g. the Mingw32 distribution, to a directory in your path.
531
532 All targets have 'clean' targets to allow removal of object files
533 and other intermediate compiler files.
534
535 Notes:
536
537 1. See also the Cygwin/Mingw32 on the web site or CD-ROM for
538    further information about using wxWindows with these compilers.
539
540 2. libwx.a is 48 MB or more - but much less if compiled with no
541    debug info (-g0) and level 4 optimization (-O4).
542
543 3. There's a bug in Mingw32 headers for some early distributions.
544
545    in include/windows32/defines.h, where it says:
546
547    #define LPSTR_TEXTCALLBACKA (LPSTR)-1L)
548
549    it should say:
550
551    #define LPSTR_TEXTCALLBACKA ((LPSTR)-1L)
552
553    (a missing bracket).
554
555 4. If there's a problem with the copy or remove commands in
556    src/msw/makefile.g95, you may need to change the COPY and
557    RM variables in makeg95.env.
558
559 5. If there's a problem executing the windres program, try
560    commenting out RCPREPROCESSOR in makeg95.env.
561
562 6. OpenGL support should work with Mingw32 as-is. However,
563    if you wish to generate import libraries appropriate either for
564    the MS OpenGL libraries or the SGI OpenGL libraries, go to
565    include/wx/msw/gl and use:
566
567      dlltool -k -d opengl.def -llibopengl.a
568
569    for the SGI DLLs, or
570
571      dlltool -k -d opengl32.def -llibopengl32.a
572
573    and similarly for glu[32].def.
574
575 References:
576
577  - The Cygwin site is at
578      http://sourceware.cygnus.com
579  - Mingw32 is available at:
580      ftp://www.mingw.org
581
582 TWIN32 and gcc on Linux
583 -----------------------
584
585 The wxWindows 2 for Windows port may be compiled using
586 the TWIN32 emulator package from www.willows.com. However,
587 TWIN32 is by no means finished so this should be taken as
588 something to think about for the future, rather than
589 a tool for writing products with.
590
591 Use makefile.twn in much the same way as makefile.g95, as
592 described above. Not all sample makefiles are supplied yet.
593
594 For some reason, I found I had to copy TWIN32's Windows resource
595 compiler (rc) to the current working directory for it to be found.
596
597 General Notes
598 -------------
599
600 - Debugging: under Windows 95, debugging output isn't output in
601   the same way that it is under NT or Windows 3.1.
602   Please see DebugView (bin/dbgview.exe in the distribution), also
603   available from http://www.sysinternals.com and on the wxWindows CD-ROM
604   under Packages.
605
606 - If you are installing wxWindows 2 from CVS, you may find that
607   include/wx/msw/setup.h is missing. This is deliberate, to avoid
608   developers' different setup.h configurations getting confused.
609   Please copy setup0.h to setup.h before compiling. Also, read
610   the BuildCVS.txt for other hints.
611