2 Installing wxWindows 2.1
3 ------------------------
5 This is a beta release of wxWindows 2.1 for Microsoft
6 Windows 95, 98 and NT. This is not a production release,
7 although a huge number of bugs found in wxWindows 2.0 have been
10 IMPORTANT NOTE: If you experience problems installing, please
11 re-read this instructions and other related files (release.txt,
12 todo.txt, bugs.txt etc.) carefully before mailing wxwin-users or
13 the author. Preferably, try to fix the problem first and
14 then send a patch to the author. Please report bugs using the
15 bug report form on the wxWindows web site.
20 A setup program is provided (setup.exe) to automatically copy files to a
21 directory on your hard disk. Do not install into a path that contains spaces.
22 The installation program should set the WXWIN environment variable, which
23 will be activated when your machine is rebooted. The setup
24 program contains the following:
26 - All common, generic and MSW-specific wxWindows source;
28 - documentation in Windows Help format;
29 - makefiles for most Windows compilers, plus BC++ and
31 - JPEG library source;
32 - Object Graphics Library;
34 - Dialog Editor binary.
36 Alternatively, you may unarchive the set of .zip files by hand,
37 where x is the minor version number and y is the release number:
39 wx2_x_y_gen.zip Generic source code and samples (required)
40 wx2_x_y_msw.zip Windows-specific source code and samples (required)
41 wx2_x_y_doc.zip Documentation source code (not required)
42 wx2_x_y_hlp.zip WinHelp documentation
43 wx2_x_y_pdf.zip Acrobat PDF documentation
44 wx2_x_y_htm.zip HTML documentation
45 wx2_x_y_vc.zip MS VC++ 5.0 project files
46 wx2_x_y_cw.zip Metrowerks CodeWarrior project files
47 wx2_x_y_bc.zip BC++ 5 project files
48 jpeg.zip Use this to allow wxImage to read and write JPEG files
49 tiff.zip Use this to allow wxImage to read and write TIFF files
51 Unarchive the required files plus any optional documentation
52 files into a suitable directory such as c:\wx.
54 Other add-on packages are available from the wxWindows Web site, such as:
56 - mmedia.zip. Audio, CD, video access for Windows and Linux.
57 - ogl3.zip. Object Graphics Library: build network diagrams, CASE tools etc.
58 - tex2rtf3.zip. Tex2RTF: create Windows Help, HTML, and Word RTF files from
59 the same document source.
61 General installation notes
62 --------------------------
64 Alter your WXWIN environment variable to point to this directory.
65 For Cygwin or Mingw32 compilation, make sure WXWIN contains only
68 If installing from the CVS server, copy include/wx/msw/setup0.h to
69 include/wx/msw/setup.h and edit the resulting file to choose the featrues you
70 would like to compile wxWindows with[out].
75 The following sections explain how to compile wxWindows with each supported
78 Visual C++ 4.0/5.0/6.0 compilation
79 ----------------------------------
81 Using project files (VC++ 5 and 6 only):
83 1. Unarchive wx2_x_y_vc.zip, the VC++ 5/6 project makefiles.
84 2. Open src/wxvc.dsp, set Debug or Release configuration for
85 the wxvc project, and compile. Alternatively, use Batch Build
86 to build both Debug and Release configurations.
87 This will produce lib/wx.lib (release) and lib/wxd.lib (debug),
88 plus various subordinate libraries. It assumes you have
89 the TIFF and JPEG source, which is already in the setup
90 version of the distribution.
91 The project file src/wxvc_dll.dsp will make a DLL version of wxWindow,
92 which will go in lib/wxdll.[lib,dll] and lib/wxdlld.[lib,dll].
93 3. Open a sample project file, choose a configuration such as
94 Debug using Build | Set Active Configuration..., and compile.
95 The project files don't use precompiled headers, to save disk
96 space, but you can switch PCH compiling on for greater speed.
100 1. Make sure your WXWIN variable is set.
101 2. If you do NOT have the TIFF or JPEG source code, please remove
102 the tiff and jpeg targets from the 'all' target in
103 src\msw\makefile.vc. Also ensure the settings in
104 include\wx\msw\setup.h specify not to use JPEG or TIFF.
105 3. Change directory to wx\src\msw. Type:
107 'nmake -f makefile.vc'
109 to make the wxWindows core library with debug information
110 (wx\lib\wx_d.lib), or
112 'nmake -f makefile.vc FINAL=1'
114 to make the wxWindows core library without debug information
116 4. Change directory to wx\samples and type 'nmake -f makefile.vc'
117 to make all the samples. You can also make them individually.
121 Use the 'clean' target to clean all objects, libraries and
124 To build the release version using makefiles, add FINAL=1 to your
125 nmake invocation, both when building the library and for samples.
127 Note that the wxWindows core library allows you to have debug
128 and release libraries available simultaneously, by compiling the
129 objects in different subdirectories, whereas samples must be
130 cleaned and re-made to build a different configuration. This
131 may be changed in later versions of wxWindows.
133 To build the DLL version using makefiles:
135 1. Change directory to wx\src\msw. Type 'nmake -f makefile.vc dll pch'
136 to make both a suitable DLL and import library, and to build a
137 suitable precompiled header file for compiling applications.
138 The resulting libraries are called:
140 wx\lib\wx[version].lib(dll) (debug version)
141 wx\lib\wx[version].lib(dll) (release version, using FINAL=1)
143 2. Invoke a sample makefile with 'nmake -f makefile.vc WXUSINGDLL=1'
144 (or edit src\makeprog.vc to set WXUSINGDLL to 1 for all
147 Note (1): if you wish to use templates, please edit
148 include\wx\msw\setup.h and set wxUSE_DEBUG_NEW_ALWAYS to 0.
149 Without this, the redefinition of 'new' will cause problems in
150 the headers. Alternatively, #undef new before including template headers.
151 You will also need to set wxUSE_IOSTREAMH to 0 if you will be
152 using templates, to avoid the non-template stream files being included
155 Note (2): libraries and applications generated with makefiles and
156 project files are now (hopefully) compatible where static libraries
157 are concerned, but please exercise caution nevertheless and if
158 possible, use one method or the other.
160 Note (3): VC++ 5's optimization code seems to be broken and can
161 cause both compile and run-time problems: this can be seen when
162 deleting an object Dialog Editor, in Release mode with optimizations
163 on. If in doubt, switch off optimisations, although this will result in much
164 larger executables. It seems possible that the library can be created with
165 strong optimization, so long as the application is not strongly
166 optimized. For example, in wxWindows project, set to 'Minimum
167 Size'. In Dialog Editor project, set to 'Customize: Favor Small
168 Code' (and no others). This will then work.
170 Similarly, in VC++ 4, optimization can cause internal compiler
171 errors, so edit src\makevc.env and change /O1 to /Od before
172 trying build a release version of the library. Or, type:
174 nmake -f makefile.vc noopt FINAL=1
176 and then resume compilation in the normal way. This will build
177 troublesome files with no optimization.
179 Note (4): some crash problems can be due to inconsistent compiler
180 options. If strange/weird/impossible things start to happen please
181 check (dumping IDE project file as makefile and doing text comparison
182 if necessary) that the project settings, especially the list of defined
183 symbols, struct packing, etc. are exactly the same for all items in
184 the project. After this, delete everything (including PCH) and recompile.
186 Visual C++ 1.5 compilation (16-bit)
187 -----------------------------------
189 1. Make sure your WXWIN variable is set, and uses the FAT (short
191 2. Change directory to wx\src\msw. Type 'nmake -f makefile.dos' to
192 make the wxWindows core library.
193 3. Change directory to a sample, such as wx\samples\minimal, and
194 type 'nmake -f makefile.dos'.
196 Add FINAL=1 to your makefile invocation to build the release
197 versions of the library and samples.
199 Use the 'clean' target to clean all objects, libraries and
202 Borland C++ 4.5/5.0 compilation
203 -------------------------------
205 Compiling using the makefiles:
207 1. Make sure your WXWIN variable is set, and uses the FAT (short
208 name) form if doing a 16-bit compile.
209 2. Change directory to wx\src\msw. Type 'make -f makefile.b32' to
210 make the wxWindows core library. Ignore the warnings about
211 'XXX' not found in library.
212 3. Change directory to a sample or demo such as samples\minimal, and type
213 'make -f makefile.b32'.
214 4. For release versions, recompile wxWindows and samples using
215 'make -f makefile.b32 clean'
216 'make -f makefile.b32 FINAL=1'
217 for the library and samples.
219 Note (1): the wxWindows library and (some) samples compile in 16-bit mode
220 using makefile.bcc, but at present the wxWindows resource system is switched
221 off in this mode. See issues.txt for details.
223 Note (2): unfortunately most samples won't link in 16-bit mode,
224 because the automatic data segment exceeds 64K. The minimal
225 sample links and runs, however.
227 Note (3): the wxWindows makefiles assume byte structure alignment. Please
228 make sure that your own project or makefile settings use the
229 same alignment, or you could experience mysterious crashes. To
230 change the alignment, add a suitable option to the $(CFG) target code
231 in src/msw/makefile.b32.
233 Note (4): if you get undefined _SQL... symbols at link time,
234 either install odbc32.lib from the BC++ CD-ROM into your BC++ lib
235 directory, or set wxUSE_ODBC to 0 in include\wx\msw\setup.h and
236 recompile wxWindows. The same applies if compiling using the IDE.
238 Note (5): BC++ 4.5 (not 5.0) trips up over jdmerge.c in the JPEG folder;
239 you will therefore need to set wxUSE_LIBJPEG to 0 in setup.h and remove
240 the jpeg target from src\msw\makefile.b32.
242 Note (6): If using C++Builder 4 and above (BC++ 5.4), change LINK=tlink32 to
243 LINK=ilink32 in src\makeb32.env.
245 Compiling using the IDE files:
247 1. Load src\bc32.ide (Release settings)
248 2. Go to Options|Project... and specify the correct BC++ include and lib path for
250 3. Press F9 to compile the wxWindows library.
251 4. Load samples\bc32.ide.
252 5. Go to Options|Project... and specify the correct BC++ include and lib path for
254 6. Press F9 to compile the samples (build each node separately if
255 you prefer, by right clicking and choose Build Node).
256 7. Run each sample: you may need to run from each sample's directory
257 since some (notably the wxHTML samples) look for files
258 relative to the working directory.
260 Note (1): the samples project file contains a selection of
261 samples, and not all samples. The remaining samples can be made
262 with the makefiles. See also the demos hierarchy which doesn't
263 have any BC++ project files yet.
265 Note (2): to make the png, xpm, zlib, jpeg and tiff libraries (needed for
266 some samples) you need to compile them with bc32.ide.
268 Note (3): the debug version of the wxWindows library is about 40 MB, and the
269 release version is around 5 MB.
271 See also the file bc_ide.txt for further instructions and details
272 of how to create your own project files.
274 Borland C++Builder compilation
275 ------------------------------
277 C++Builder compilation is the same as for Borland C++ above.
279 Tested with C++Builder 1.0 and 3.0. Only makefiles are currently
282 Watcom C++ 10.6/11 compilation
283 ---------------------------
285 1. Make sure your WXWIN variable is set, and uses the DOS short
287 2. Change directory to wx\src\msw. Type 'wmake -f makefile.wat' to
288 make the wxWindows core library.
289 3. Change directory to wx\samples\minimal and type 'wmake -f makefile.wat'
290 to make this sample. Repeat for other samples of interest.
292 Note (1): setup.h overrides wxUSE_LIBJPEG and sets it to 0, since
293 imagjpeg.cpp doesn't compile.
294 Note (2): makewat.env uses the odbc32.lib supplied in wxWindows' lib\watcom
295 directory. See the notes in that directory.
296 Note (3): if variant.cpp is compiled with date/time class
297 options, the linker gives up. So the date/time option is switched
298 off for Watcom C++. Also, wxAutomationObject is not compiled with
300 Note (4): if Watcom can't read the precompiled header when
301 building a sample, try deleting src\msw\watcom.pch and
302 compiling the sample again.
303 Note (5): if you get _popen_ and _pclose_ link errors, try
304 recompiling wxWindows with XPM support disabled in setup.h.
305 Alternatively, make sure these lines exist at the top of
308 // Added by JACS for Watcom C++/wxWindows compilation (no popen/pclose functions)
313 Metrowerks CodeWarrior compilation
314 ----------------------------------
316 1. Downloaded and unzip wx2_x_y_cw.zip.
317 2. Load the make_cw.mcp project in wx\src, and compile.
318 3. Load the make_cw.mcp project in wx\samples\minimal, and compile.
319 Further project files for samples will be available in due
322 Note (1): you need CodeWarrior Pro 4 plus the patches to 4.1 from the
325 Note (2): unfortunately these files are not yet up-to-date for the
328 Symantec C++ compilation
329 ------------------------
331 1. Make sure your WXWIN variable is set, and uses the FAT (short
333 2. Edit setup.h and set wxUSE_DRAG_AND_DROP to 0.
334 3. Change directory to wx\src\msw. Type 'make -f makefile.sc' to
335 make the wxWindows core library.
336 4. Change directory to wx\samples\minimal and type 'make -f makefile.sc'
339 Note: the minimal sample doesn't link properly ('Error: no
341 32-bit compilation only (partially) supported at present, using SC++ 6.1.
342 Some functionality is missing using this compiler (see makefile).
343 Add -D__WIN95__ if your SC++ has Windows 95 support, and ignore
344 Step (2). 16-bit compilation is left as an excercise for the user!
346 Salford C++ compilation
347 -----------------------
349 1. Make sure your WXWIN variable is set, and uses the FAT (short
351 2. Edit SALFORDDIR and RESOURCEDIR in src/makesl.env as per
353 3. Change directory to wx\src\msw. Type 'mk32 -f makefile.sl all' to
354 make the wxWindows core library.
355 4. Change directory to wx\samples\minimal and type 'mk32 -f makefile.sl'
358 Unfortunately, Salford C++ seems to have problems with its code generation for
359 operations on objects, as seen in wxFrame::OnMenuHighlight
360 (minimal sample) or wxWindow::SetValidator (mdi sample). Also the
361 the debugging version of the library is 90MB, with samples coming in
362 at 40MB :-) However, wxWindows at least makes a good test suite for
363 improving the compiler.
365 Cygwin b19/b20/Mingw32 compilation
366 ----------------------------------
368 wxWindows 2 supports Cygwin (formerly GnuWin32) b19, b20, Mingw32, and Mingw32/EGCS.
370 Thanks are due to Keith Garry Boyce (garp@opustel.com) and Cygnus for making
373 From wxWindows 2.0 beta 9, both Cygwin and Mingw32 (the minimal
374 distribution of Cygwin) can be used with the same makefiles.
376 Here are the steps required:
378 - Retrieve and install the latest beta of Cygwin, or Mingw32, as per the
379 instructions with either of these packages.
381 - If using Mingw32 (including the EGCS variant), you need some
382 extra files to use the wxWindows makefiles. You can find these
383 files in ports/mingw32 on the ftp site or CD-ROM, as extra.zip.
384 These should be extracted to the Mingw32 directory.
385 If you have already have downloaded bison, flex, make, rm, cp, mv
386 from elsewhere, you won't need this.
388 If using Mingw32 2.8.1, see also see mingw32.txt in this directory
389 (docs/msw) about a fix that has to be applied to a Mingw32 header file.
391 If using Mingw32 2.95 with wxWindows 2.1 or above, and wish to use OLE, you
392 should hand-patch in Mingw32-gcc295.patches (located in the top-level of the
393 wxWindows 2 installation).
395 - Modify the file wx/src/cygnus.bat (or mingw32.bat or mingegcs.bat)
396 to set up appropriate variables, if necessary mounting drives.
397 Run it before compiling.
399 - For Cygwin, make sure there's a \tmp directory on your
400 Windows drive or bison will crash.
402 - Edit wx/src/makeg95.env and set the MINGW32 variable at the top of
403 the file to either 1 (you have Mingw32) or 0 (you have Cygwin32).
404 If using MINGW32, also set the MINGW32VERSION variable
407 - Mingw32 may not support winsock.h, so if you have a problem
408 here, comment out socket-related files in src/msw/makefile.g95.
410 - Set your WXWIN variable to where wxWindows is installed.
411 *** IMPORTANT: For Cygwin/Mingw32, use forward slashes in the path, not
414 - Use the makefile.g95 files for compiling wxWindows and samples,
417 > make -f makefile.g95
418 > cd c:\wx\samples\minimal
419 > make -f makefile.g95
421 Ignore the warning about the default entry point.
423 - Use the 'strip' command to reduce executable size.
425 - With Cygnus Cygwin, you can invoke gdb --nw myfile.exe to
426 debug an executable. If there are memory leaks, they will be
427 flagged when the program quits.
429 - If using GnuWin32 b18, you will need to copy windres.exe
430 from e.g. the Mingw32 distribution, to a directory in your path.
432 All targets have 'clean' targets to allow removal of object files
433 and other intermediate compiler files.
437 1. See also the Cygwin/Mingw32 on the web site or CD-ROM for
438 further information about using wxWindows with these compilers.
440 2. libwx.a is 48 MB or more - but much less if compiled with no
441 debug info (-g0) and level 4 optimization (-O4).
443 3. There's a bug in Mingw32 headers for some early distributions.
445 in include/windows32/defines.h, where it says:
447 #define LPSTR_TEXTCALLBACKA (LPSTR)-1L)
451 #define LPSTR_TEXTCALLBACKA ((LPSTR)-1L)
455 4. If there's a problem with the copy command in
456 src/msw/makefile.g95, you may need to change the COPY and
457 COPYSEP variables in makeg95.env.
459 5. If there's a problem executing the windres program, try
460 commenting out RCPREPROCESSOR in makeg95.env.
464 - The GNU-WIN32 site is at
465 http://www.cygnus.com/gnu-win32/
466 - Mingw32 is available at:
467 ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95/
468 - See also http://web.ukonline.co.uk/julian.smart/wxwin/gnuwin32.htm
470 TWIN32 and gcc on Linux
471 -----------------------
473 The wxWindows 2 for Windows port may be compiled using
474 the TWIN32 emulator package from www.willows.com. However,
475 TWIN32 is by no means finished so this should be taken as
476 something to think about for the future, rather than
477 a tool for writing products with.
479 Use makefile.twn in much the same way as makefile.g95, as
480 described above. Not all sample makefiles are supplied yet.
482 For some reason, I found I had to copy TWIN32's Windows resource
483 compiler (rc) to the current working directory for it to be found.
488 - Debugging: under Windows 95, debugging output isn't output in
489 the same way that it is under NT or Windows 3.1. Set
490 wxUSE_DBWIN32 to 1 if you wish to enable code to output debugging
491 info to an external debug monitor, such as Andrew Tucker's DBWIN32.
492 You can download DBWIN32 from:
494 http://ftp.digital.com/pub/micro/NT/WinSite/programr/dbwin32.zip
496 and it's also on the wxWindows CD-ROM under Packages.
498 - If you are installing wxWindows 2 from CVS, you may find that
499 include/wx/msw/setup.h is missing. This is deliberate, to avoid
500 developers' different setup.h configurations getting confused.
501 Please copy setup0.h to setup.h before compiling.