]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/msw/install.txt
wxSetEnv for Win32 (doesn't really work)
[wxWidgets.git] / docs / msw / install.txt
... / ...
CommitLineData
1
2Installing wxWindows 2.2
3------------------------
4
5This is wxWindows 2.2 for Microsoft Windows 3.1, 95, 98 and
6Windows NT/Windows 2000. This is an official, stable release.
7
8IMPORTANT NOTE: If you experience problems installing, please
9re-read this instructions and other related files (changes.txt,
10readme.txt, notes on the Web site) carefully before mailing
11wx-users or the author. Preferably, try to fix the problem first and
12then send a patch to the author. Please report bugs using the
13bug report form on the wxWindows web site.
14
15Unarchiving
16-----------
17
18A setup program is provided (setup.exe) to automatically copy files to a
19directory on your hard disk. Do not install into a path that contains spaces.
20The installation program should set the WXWIN environment variable, which
21will be activated when your machine is rebooted. The setup
22program 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
35Alternatively, you may unarchive the .zip form by hand:
36wxMSW-x.y.z.zip where x.y.z is the version number.
37
38Unarchive the required files plus any optional documentation
39files into a suitable directory such as c:\wx.
40
41Other 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
48General installation notes
49--------------------------
50
51Alter your WXWIN environment variable to point to this directory.
52For Cygwin or Mingw32 compilation, make sure WXWIN contains only
53forward slashes.
54
55If installing from the CVS server, copy include/wx/msw/setup0.h to
56include/wx/msw/setup.h and edit the resulting file to choose the featrues you
57would like to compile wxWindows with[out].
58
59Compilation
60-----------
61
62The following sections explain how to compile wxWindows with each supported
63compiler.
64
65Visual C++ 4.0/5.0/6.0 compilation
66----------------------------------
67
68Using project files (VC++ 5 and 6 only):
69
701. 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).
722. 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].
813. 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
90Using makefiles:
91
921. Make sure your WXWIN variable is set.
932. 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.
973. 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).
1094. Change directory to wx\samples and type 'nmake -f makefile.vc'
110 to make all the samples. You can also make them individually.
111
112Makefile 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
131To build the DLL version using makefiles:
132
1331. 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
1412. 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
145Note (1): if you wish to use templates, please edit
146include\wx\msw\setup.h and set wxUSE_DEBUG_NEW_ALWAYS to 0.
147Without this, the redefinition of 'new' will cause problems in
148the headers. Alternatively, #undef new before including template headers.
149You will also need to set wxUSE_IOSTREAMH to 0 if you will be
150using templates, to avoid the non-template stream files being included
151within wxWindows.
152
153Note (2): libraries and applications generated with makefiles and
154project files are now (hopefully) compatible where static libraries
155are concerned, but please exercise caution nevertheless and if
156possible, use one method or the other.
157
158Note (3): VC++ 5's optimization code seems to be broken and can
159cause both compile and run-time problems: this can be seen when
160deleting an object Dialog Editor, in Release mode with optimizations
161on. If in doubt, switch off optimisations, although this will result in much
162larger executables. It seems possible that the library can be created with
163strong optimization, so long as the application is not strongly
164optimized. For example, in wxWindows project, set to 'Minimum
165Size'. In Dialog Editor project, set to 'Customize: Favor Small
166Code' (and no others). This will then work.
167
168Similarly, in VC++ 4, optimization can cause internal compiler
169errors, so edit src\makevc.env and change /O1 to /Od before
170trying build a release version of the library. Or, type:
171
172nmake -f makefile.vc noopt FINAL=1
173
174and then resume compilation in the normal way. This will build
175troublesome files with no optimization. However, there now seems to be
176an internal linker error using VC++ 4, in addition to internal
177compiler errors for most of the samples, so this version of the compiler
178cannot be recommended!
179
180Note (4): some crash problems can be due to inconsistent compiler
181options. If strange/weird/impossible things start to happen please
182check (dumping IDE project file as makefile and doing text comparison
183if necessary) that the project settings, especially the list of defined
184symbols, struct packing, etc. are exactly the same for all items in
185the project. After this, delete everything (including PCH) and recompile.
186
187Note (5): for some further notes about upgrading your project
188files to be compatible with wxWindows 2.1.14, please see
189"Highlights of wxWindows" from the Download page of the
190web site or CD-ROM.
191
192Note (6): to create your own IDE files, see the technical note on the
193wxWindows web site or CD-ROM, entitled "Compiling wxWindows
194applications in the VC++ IDE" (technical note docs/tech/tn0010.htm in the
195wxWindows distribution). You can also copy .dsp and .dsw
196files from an existing wxWindows sample and adapt them.
197
198Visual C++ 1.5 compilation (16-bit)
199-----------------------------------
200
2011. Make sure your WXWIN variable is set, and uses the FAT (short
202 name) form.
2032. Change directory to wx\src\msw. Type 'nmake -f makefile.dos' to
204 make the wxWindows core library.
2053. Change directory to a sample, such as wx\samples\minimal, and
206 type 'nmake -f makefile.dos'.
207
208Add FINAL=1 to your makefile invocation to build the release
209versions of the library and samples.
210
211Use the 'clean' target to clean all objects, libraries and
212executables.
213
214Borland C++ 4.5/5.0 compilation
215-------------------------------
216
217Compiling using the makefiles:
218
2191. Make sure your WXWIN variable is set, and uses the FAT (short
220 name) form if doing a 16-bit compile.
2212. 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.
2243. Change directory to a sample or demo such as samples\minimal, and type
225 'make -f makefile.b32'.
2264. 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.
2305. 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
238Note (1): the wxWindows library and (some) samples compile in 16-bit mode
239using makefile.bcc, but at present the wxWindows resource system is switched
240off in this mode. See issues.txt for details.
241
242Note (2): unfortunately most samples won't link in 16-bit mode,
243because the automatic data segment exceeds 64K. The minimal
244sample links and runs, however.
245
246Note (3): the wxWindows makefiles assume byte structure alignment. Please
247make sure that your own project or makefile settings use the
248same alignment, or you could experience mysterious crashes. To
249change the alignment, add a suitable option to the $(CFG) target code
250in src/msw/makefile.b32.
251
252Note (4): if you get undefined _SQL... symbols at link time,
253either install odbc32.lib from the BC++ CD-ROM into your BC++ lib
254directory, or set wxUSE_ODBC to 0 in include\wx\msw\setup.h and
255recompile wxWindows. The same applies if compiling using the IDE.
256
257Note (5): BC++ 4.5 (not 5.0) trips up over jdmerge.c in the JPEG folder;
258you will therefore need to set wxUSE_LIBJPEG to 0 in setup.h and remove
259the jpeg target from src\msw\makefile.b32, and remove jpeg from
260src\makeprog.b32.
261
262Note (6): If using C++Builder 4 and above (BC++ 5.4 and above), change LINK=tlink32 to
263LINK=ilink32 in src\makeb32.env. You may also need to disable
264wxUSE_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
267Note (7): If you wish debug messages to be sent to the console in
268debug mode, edit src\makeb32.env and change /aa to /Tpe in
269LINK_FLAGS.
270
271Compiling using the IDE files:
272
2731. Load src\bc32.ide (Release settings)
2742. Go to Options|Project... and specify the correct BC++ include and lib path for
275 your file structure.
2763. Press F9 to compile the wxWindows library.
2774. Load samples\bc32.ide.
2785. Go to Options|Project... and specify the correct BC++ include and lib path for
279 your file structure.
2806. Press F9 to compile the samples (build each node separately if
281 you prefer, by right clicking and choose Build Node).
2827. 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
286Note (1): the samples project file contains a selection of
287samples, and not all samples. The remaining samples can be made
288with the makefiles. See also the demos hierarchy which doesn't
289have any BC++ project files yet.
290
291Note (2): to make the png, xpm, zlib, jpeg and tiff libraries (needed for
292some samples) you need to compile them with bc32.ide.
293
294Note (3): the debug version of the wxWindows library is about 40 MB, and the
295release version is around 5 MB.
296
297See also the file docs/tech/tn0007.txt for further instructions and details
298of how to create your own project files.
299
300Borland C++ 5.5 compilation
301---------------------------
302
303Before compiling wxWindows with Borland C++ 5.5, there are a few
304issues concerning the compiler installation:
305
3061. 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
3102. 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
3213. 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
3364. 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
340Compiling wxWindows:
341
342Once the compiler and its service pack are properly installed, you build
343wxWindows using the provided makefile.b32 in the src/msw directory:
344
345a. 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
352b. 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
361IMPORTANT:
362The Service Pack 1 for Borland C++ 5.5 must be installed before wxWindows
363is compiled. If you compiled wxWindows before, it is advised that you
364re-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
374In all of your wxWindows applications, your source code should include
375the 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
382more details)
383
384Borland C++Builder compilation
385------------------------------
386
3871. 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
3922. 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
396Watcom C++ 10.6/11 compilation
397---------------------------
398
3991. Make sure your WXWIN variable is set, and uses the DOS short
400 name form.
4012. Change directory to wx\src\msw. Type 'wmake -f makefile.wat' to
402 make the wxWindows core library.
4033. Change directory to wx\samples\minimal and type 'wmake -f makefile.wat'
404 to make this sample. Repeat for other samples of interest.
405
406Note (1): makewat.env uses the odbc32.lib supplied in wxWindows' lib\watcom
407directory. See the notes in that directory.
408Note (2): if variant.cpp is compiled with date/time class
409options, the linker gives up. So the date/time option is switched
410off for Watcom C++. Also, wxAutomationObject is not compiled with
411Watcom C++.
412Note (3): if Watcom can't read the precompiled header when
413building a sample, try deleting src\msw\watcom.pch and
414compiling the sample again.
415Note (4): if you get _popen_ and _pclose_ link errors, try
416recompiling wxWindows with XPM support disabled in setup.h.
417Alternatively, make sure these lines exist at the top of
418src\xpm\xpmi.h:
419
420// Added by JACS for Watcom C++/wxWindows compilation (no popen/pclose functions)
421#ifdef __WATCOMC__
422#define NO_ZPIPE
423#endif
424
425Metrowerks CodeWarrior compilation
426----------------------------------
427
4281. Downloaded and unzip wxWindows-x.y.z-cw.zip.
4292. Load the make_cw.mcp project in wx\src, and compile.
4303. Load the make_cw.mcp project in wx\samples\minimal, and compile.
431 Further project files for samples will be available in due
432 course.
433
434Note (1): you need CodeWarrior Pro 4 plus the patches to 4.1 from the
435Metrowerks Web site.
436
437Note (2): unfortunately these files are not yet up-to-date for the
438current release.
439
440Symantec C++ compilation
441------------------------
442
4431. Make sure your WXWIN variable is set, and uses the FAT (short
444 name) form.
4452. Edit setup.h and set wxUSE_DRAG_AND_DROP to 0.
4463. Change directory to wx\src\msw. Type 'make -f makefile.sc' to
447 make the wxWindows core library.
4484. Change directory to wx\samples\minimal and type 'make -f makefile.sc'
449 to make this sample.
450
451Note: the minimal sample doesn't link properly ('Error: no
452start address').
45332-bit compilation only (partially) supported at present, using SC++ 6.1.
454Some functionality is missing using this compiler (see makefile).
455Add -D__WIN95__ if your SC++ has Windows 95 support, and ignore
456Step (2). 16-bit compilation is left as an excercise for the user!
457
458Salford C++ compilation
459-----------------------
460
4611. Make sure your WXWIN variable is set, and uses the FAT (short
462 name) form.
4632. Edit SALFORDDIR and RESOURCEDIR in src/makesl.env as per
464 notes.
4653. Change directory to wx\src\msw. Type 'mk32 -f makefile.sl all' to
466 make the wxWindows core library.
4674. Change directory to wx\samples\minimal and type 'mk32 -f makefile.sl'
468 to make this sample.
469
470Unfortunately, Salford C++ seems to have problems with its code generation for
471operations on objects, as seen in wxFrame::OnMenuHighlight
472(minimal sample) or wxWindow::SetValidator (mdi sample). Also the
473the debugging version of the library is 90MB, with samples coming in
474at 40MB :-) However, wxWindows at least makes a good test suite for
475improving the compiler.
476
477Cygwin/Mingw32 compilation
478----------------------------------
479
480wxWindows 2 supports Cygwin (formerly GnuWin32) betas and
481releases, and Mingw32.
482
483Thanks are due to Keith Garry Boyce (garp@opustel.com), Cygnus
484and others for making it all possible.
485
486Both Cygwin and Mingw32 (the minimal distribution of Cygwin) can be used
487with the same makefiles.
488
489Here are the steps required:
490
491- Retrieve and install the latest beta of Cygwin, or Mingw32, as per the
492 instructions with either of these packages.
493
494- If using Mingw32, you need some extra files to use the wxWindows
495 makefiles. You can find these files in ports/mingw32 on the
496 wxWindows ftp site or CD-ROM, as extra.zip. These should be extracted
497 to the Mingw32 directory. If you have alread downloaded rm, cp, mv
498 from elsewhere, you won't need this.
499
500 If using Mingw32 2.95 and below with wxWindows 2.1 or above, you
501 must hand-patch with Mingw32-gcc295.patches (located in the
502 top-level of the wxWindows 2 installation). Mingw32 2.95.2
503 and above contain the fixes already.
504
505- Modify the file wx/src/cygnus.bat (or mingw32.bat or mingegcs.bat)
506 to set up appropriate variables, if necessary mounting drives.
507 Run it before compiling.
508
509- For Cygwin, make sure there's a \tmp directory on your
510 Windows drive or bison will crash (actually you don't need
511 bison for ordinary wxWindows compilation: a pre-generated .c file is
512 supplied).
513
514- Edit wx/src/makeg95.env and set the MINGW32 variable at the top of
515 the file to either 1 (you have Mingw32 or Cygwin 1.x releases) or 0
516 (if you have Cygwin betas). If using Mingw32, also set the
517 MINGW32VERSION variable appropriately.
518
519- Set your WXWIN variable to where wxWindows is installed.
520 *** IMPORTANT: For Cygwin/Mingw32, use forward slashes in the path, not
521 backslashes.
522
523- Use the makefile.g95 files for compiling wxWindows and samples,
524 e.g.:
525 > cd c:\wx\src\msw
526 > make -f makefile.g95
527 > cd c:\wx\samples\minimal
528 > make -f makefile.g95
529
530 Ignore the warning about the default entry point.
531
532- Use the 'strip' command to reduce executable size.
533
534- With Cygwin, you can invoke gdb --nw myfile.exe to
535 debug an executable. If there are memory leaks, they will be
536 flagged when the program quits.
537
538- If using GnuWin32 b18, you will need to copy windres.exe
539 from e.g. the Mingw32 distribution, to a directory in your path.
540
541All targets have 'clean' targets to allow removal of object files
542and other intermediate compiler files.
543
544Notes:
545
5461. See also the Cygwin/Mingw32 on the web site or CD-ROM for
547 further information about using wxWindows with these compilers.
548
5492. libwx.a is 48 MB or more - but much less if compiled with no
550 debug info (-g0) and level 4 optimization (-O4).
551
5523. There's a bug in Mingw32 headers for some early distributions.
553
554 in include/windows32/defines.h, where it says:
555
556 #define LPSTR_TEXTCALLBACKA (LPSTR)-1L)
557
558 it should say:
559
560 #define LPSTR_TEXTCALLBACKA ((LPSTR)-1L)
561
562 (a missing bracket).
563
5644. If there's a problem with the copy or remove commands in
565 src/msw/makefile.g95, you may need to change the COPY and
566 RM variables in makeg95.env.
567
5685. If there's a problem executing the windres program, try
569 commenting out RCPREPROCESSOR in makeg95.env.
570
5716. OpenGL support should work with Mingw32 as-is. However,
572 if you wish to generate import libraries appropriate either for
573 the MS OpenGL libraries or the SGI OpenGL libraries, go to
574 include/wx/msw/gl and use:
575
576 dlltool -k -d opengl.def -llibopengl.a
577
578 for the SGI DLLs, or
579
580 dlltool -k -d opengl32.def -llibopengl32.a
581
582 and similarly for glu[32].def.
583
584References:
585
586 - The Cygwin site is at
587 http://sourceware.cygnus.com
588 - Mingw32 is available at:
589 ftp://www.mingw.org
590
591TWIN32 and gcc on Linux
592-----------------------
593
594The wxWindows 2 for Windows port may be compiled using
595the TWIN32 emulator package from www.willows.com. However,
596TWIN32 is by no means finished so this should be taken as
597something to think about for the future, rather than
598a tool for writing products with.
599
600Use makefile.twn in much the same way as makefile.g95, as
601described above. Not all sample makefiles are supplied yet.
602
603For some reason, I found I had to copy TWIN32's Windows resource
604compiler (rc) to the current working directory for it to be found.
605
606General Notes
607-------------
608
609- Debugging: under Windows 95, debugging output isn't output in
610 the same way that it is under NT or Windows 3.1.
611 Please see DebugView (bin/dbgview.exe in the distribution), also
612 available from http://www.sysinternals.com and on the wxWindows CD-ROM
613 under Packages.
614
615- If you are installing wxWindows 2 from CVS, you may find that
616 include/wx/msw/setup.h is missing. This is deliberate, to avoid
617 developers' different setup.h configurations getting confused.
618 Please copy setup0.h to setup.h before compiling. Also, read
619 the BuildCVS.txt for other hints.
620