]> git.saurik.com Git - wxWidgets.git/blame - docs/msw/install.txt
GUI display problems fixed
[wxWidgets.git] / docs / msw / install.txt
CommitLineData
2bda0e17 1
0544bc0a
RR
2Installing wxWindows 2.1
3------------------------
4
733dac47 5This is a snapshot release of wxWindows 2.1 for
0544bc0a
RR
6Microsoft Windows 95, 98 and NT. This is not a production release,
7although a huge number of bugs found in wxWindows 2.0 have been
8fixed.
9
dbda9e86
JS
10IMPORTANT NOTE: If you experience problems installing, please
11re-read this instructions and other related files (todo.txt,
12bugs.txt etc.) carefully before mailing wxwin-users or
13the author. Preferably, try to fix the problem first and
14then send a patch to the author.
15
2bda0e17
KB
16Unarchiving
17-----------
18
19If there is a setup program, run the setup program that comes with the Windows version.
20Do not install into a path that contains spaces. The installation program should set the
21WXWIN environment variable, which will be activated when your machine is rebooted.
22
23If there is no setup program, it will come as a series of .zip
24files:
25
26wx200gen.zip Generic source code and samples (required)
27wx200msw.zip Windows-specific source code and samples (required)
28wx200doc.zip Documentation source code (not required)
29wx200hlp.zip WinHelp documentation
2bda0e17
KB
30wx200pdf.zip Acrobat PDF documentation
31wx200htm.zip HTML documentation
a367b9b3 32wx200vc.zip MS VC++ 5.0 project files
3b1de9c2 33wx200cw.zip Metrowerks CodeWarrior project files
33b64e6f 34wx200bc.zip BC++ 5 project files
2bda0e17
KB
35
36Unarchive the required files plus any optional documentation
dbda9e86 37files into a suitable directory such as c:\wx.
2bda0e17 38
8870c26e
JS
39Other add-on packages are available from the wxWindows Web site, such as:
40
41- glcanvas.zip. Use OpenGL in a wxWindows window.
42- ogl3.zip. Object Graphics Library: build network diagrams, CASE tools etc.
43- tex2rtf3.zip. Tex2RTF: create Windows Help, HTML, and Word RTF files from
44 the same document source.
45
dbda9e86
JS
46General installation notes
47--------------------------
48
49Alter your WXWIN environment variable to point to this directory.
50For Cygwin or Mingw32 compilation, make sure WXWIN contains only
51forward slashes.
52
53If installing from the CVS server, copy include/wx/msw/setup0.h to
f74ececa
VZ
54include/wx/msw/setup.h and edit the resulting file to choose the featrues you
55would like to compile wxWindows with[out].
dbda9e86 56
2bda0e17
KB
57Compilation
58-----------
59
dbda9e86
JS
60The following sections explain how to compile wxWindows with each supported
61compiler.
2bda0e17 62
4fabb575
JS
63Visual C++ 4.0/5.0/6.0 compilation
64----------------------------------
2bda0e17 65
a367b9b3
JS
66Using project files:
67
36edded9 681. Unarchive wx200vc.zip, the VC++ 5/6 project makefiles.
a367b9b3 692. Open src/wxvc.dsp, set Debug or Release configuration, and
cba2db0c
JS
70 compile. This will produce src/Debug/wxvc.lib or
71 src/Release/wxvc.lib. The project file src/wxvc_dll.dsp
72 will make a DLL version of wxWindow, which will go in
73 src/DebugDLL/wxvc.[lib,dll] and src/ReleaseDLL/wxvc.[lib,dll].
85f3749f
JS
743. If you want to use JPEG in your application (such as the image
75 sample), open src/jpeg/jpeg.dsp (VC++ 6 only) and compile in
76 Debug and Release configurations. If you have VC++ 5 or
77 earlier, use makefile.vc, but you may only have one set of object
78 files at a time in use (debug or release).
794. Open a sample project file, choose a configuration, and compile.
16553659
JS
80 The project files don't use precompiled headers, to save
81 space, but you can switch PCH compiling on for greater speed.
a367b9b3
JS
82
83Using makefiles:
84
62448488 851. Make sure your WXWIN variable is set.
ca5c8b2d
JS
862. Change directory to wx\src\msw. Type:
87
88 'nmake -f makefile.vc'
89
90 to make the wxWindows core library with debug information
91 (wx\lib\wx_d.lib), or
92
93 'nmake -f makefile.vc FINAL=1'
94
95 to make the wxWindows core library without debug information
96 (wx\lib\wx.lib).
85f3749f
JS
973. If you wish to use JPEG in your applications, do the same
98 procedure in src\jpeg but add the 'all' target to the
99 command line.
1004. Change directory to wx\samples and type 'nmake -f makefile.vc'
2bda0e17
KB
101 to make all the samples. You can also make them individually.
102
ca5c8b2d 103Notes:
e2a6f233 104
ca5c8b2d
JS
105 Use the 'clean' target to clean all objects, libraries and
106 executables.
107
108 To build the release version using makefiles, add FINAL=1 to your
109 nmake invocation, both when building the library and for samples.
110
111 Note that the wxWindows core library allows you to have debug
112 and release libraries available simultaneously, by compiling the
113 objects in different subdirectories, whereas samples must be
114 cleaned and re-made to build a different configuration. This
115 may be changed in later versions of wxWindows.
e2a6f233
JS
116
117To build the DLL version using makefiles:
118
1191. Change directory to wx\src\msw. Type 'nmake -f makefile.vc dll pch'
120 to make both a suitable DLL and import library, and to build a
121 suitable precompiled header file for compiling applications.
ca5c8b2d
JS
122 The resulting libraries are called:
123
124 wx\lib\wx200_d.lib(dll) (debug version)
125 wx\lib\wx200.lib(dll) (release version, using FINAL=1)
126
1272. Invoke a sample makefile with 'nmake -f makefile.vc WXUSINGDLL=1'
128 (or edit src\makeprog.vc to set WXUSINGDLL to 1 for all
129 applications).
e2a6f233 130
3f1af920 131Note (1): if you wish to use templates, please edit
025e88c5
JS
132include\wx\msw\setup.h and set wxUSE_DEBUG_NEW_ALWAYS to 0.
133Without this, the redefinition of 'new' will cause problems in
134the headers. Alternatively, #undef new before including template headers.
dbda9e86
JS
135You will also need to set wxUSE_IOSTREAMH to 0 if you will be
136using templates, to avoid the non-template stream files being included
137within wxWindows.
025e88c5 138
3f1af920
JS
139Note (2): libraries and applications generated with makefiles and
140project files are unlikely to be compatible, so use one method or
141the other.
142
750b78ba 143Note (3): VC++ 5's optimization code seems to be broken and can
ad556aa9
JS
144cause both compile and run-time problems: this can be seen when
145deleting an object Dialog Editor, in Release mode with optimizations
146on. If in doubt, switch off optimisations, although this will result in much
750b78ba
JS
147larger executables. It seems possible that the library can be created with
148strong optimization, so long as the application is not strongly
149optimized. For example, in wxWindows project, set to 'Minimum
150Size'. In Dialog Editor project, set to 'Customize: Favor Small
151Code' (and no others). This will then work.
152
6474416b
JS
153Similarly, in VC++ 4, optimization can cause internal compiler
154errors, so edit src\makevc.env and change /O1 to /Od before
155trying build a release version of the library.
156
ad813b00
JS
157Note (4): some crash problems can be due to inconsistent compiler
158options. If strange/weird/impossible things start to happen please
159check (dumping IDE project file as makefile and doing text comparison
160if necessary) that the project settings, especially the list of defined
161symbols, struct packing, etc. are exactly the same for all items in
162the project. After this, delete everything (including PCH) and recompile.
163
8fb3a512
JS
164Visual C++ 1.5 compilation (16-bit)
165-----------------------------------
2bda0e17 166
62448488
JS
1671. Make sure your WXWIN variable is set, and uses the FAT (short
168 name) form.
1692. Change directory to wx\src\msw. Type 'nmake -f makefile.dos' to
2bda0e17 170 make the wxWindows core library.
62448488 1713. Change directory to a sample, such as wx\samples\minimal, and
f60d0f94 172 type 'nmake -f makefile.dos'.
2bda0e17 173
e2a6f233
JS
174Add FINAL=1 to your makefile invocation to build the release
175versions of the library and samples.
176
177Use the 'clean' target to clean all objects, libraries and
178executables.
179
2bda0e17
KB
180Borland C++ 4.5/5.0 compilation
181-------------------------------
182
ca5c8b2d
JS
183Compiling using the makefiles:
184
62448488
JS
1851. Make sure your WXWIN variable is set, and uses the FAT (short
186 name) form if doing a 16-bit compile.
1872. Change directory to wx\src\msw. Type 'make -f makefile.b32' to
188 make the wxWindows core library. Ignore the warnings about
189 'XXX' not found in library.
1903. Change directory to a sample such as minimal, and type
191 'make -f makefile.b32'.
4bf78aae
JS
1924. For release versions, recompile wxWindows and samples using
193 'make -f makefile.b32 clean'
194 'make -f makefile.b32 FINAL=1'
195 for the library and samples.
62448488 196
1a7f3062 197Note (1): the wxWindows library and (some) samples compile in 16-bit mode
3b1de9c2
JS
198using makefile.bcc, but at present the wxWindows resource system is switched
199off in this mode. See issues.txt for details.
2bda0e17 200
8fb3a512
JS
201Note (2): unfortunately most samples won't link in 16-bit mode,
202because the automatic data segment exceeds 64K. The minimal
203sample links and runs, however.
204
205Note (3): the wxWindows makefiles assume byte structure alignment. Please
1a7f3062
JS
206make sure that your own project or makefile settings use the
207same alignment, or you could experience mysterious crashes. To
208change the alignment, add a suitable option to the $(CFG) target code
209in src/msw/makefile.b32.
210
ca5c8b2d
JS
211Compiling using the IDE files:
212
33b64e6f 2131. Load src\bc32.ide (or src\bc32d.ide for a debugging version).
ca5c8b2d
JS
2142. Go to Options|Project... and specify the correct BC++ include and lib path for
215 your file structure.
2163. Press F9 to compile the wxWindows library.
33b64e6f 2174. Load samples\bc32.ide.
ca5c8b2d
JS
2185. Go to Options|Project... and specify the correct BC++ include and lib path for
219 your file structure.
2206. Press F9 to compile the samples.
221
33b64e6f
JS
222Note that to make the png, xpm and zlib libraries (needed for
223some samples) you need to compile with bc32.ide. bc32d.ide only
224makes the wxWindows library (lib\wx32d.lib).
225
226The debug version of the wxWindows library is about 37 MB, and the
227release version is around 3 MB.
228
ca5c8b2d
JS
229See also the file bc_ide.txt for further instructions and details
230of how to create your own project files.
231
4bf78aae
JS
232Borland C++Builder compilation
233------------------------------
234
235C++Builder compilation is the same as for Borland C++ above.
3f1af920
JS
236
237Tested with C++Builder 1.0 and 3.0. Only makefiles are currently
238supplied.
4bf78aae 239
ace03f87 240Watcom C++ 10.6/11 compilation
7be1f0d9
JS
241---------------------------
242
cba2db0c
JS
2431. Make sure your WXWIN variable is set, and uses the DOS short
244 name form.
62448488 2452. Change directory to wx\src\msw. Type 'wmake -f makefile.wat' to
7be1f0d9 246 make the wxWindows core library.
62448488 2473. Change directory to wx\samples\minimal and type 'wmake -f makefile.wat'
ace03f87
JS
248 to make this sample. Repeat for other samples of interest.
249
250Note (1): setup.h overrides wxUSE_LIBJPEG and sets it to 0, since
251imagjpeg.cpp doesn't compile.
252Note (2): makewat.env uses the odbc32.lib supplied in wxWindows' lib\watcom
253directory. See the notes in that directory.
7be1f0d9 254
62448488
JS
255Metrowerks CodeWarrior compilation
256----------------------------------
257
3b1de9c2
JS
2581. Downloaded and unzip wx200cw.zip.
2592. Load the make_cw.mcp project in wx\src, and compile.
2603. Load the make_cw.mcp project in wx\samples\minimal, and compile.
261 Further project files for samples will be available in due
262 course.
62448488 263
8fb3a512 264Note (1): you need CodeWarrior Pro 4 plus the patches to 4.1 from the
33b64e6f 265Metrowerks Web site.
0a240683 266
8fb3a512
JS
267Note (2): unfortunately these files are not yet up-to-date for the
268current release.
269
3f1af920
JS
270Symantec C++ compilation
271------------------------
272
2731. Make sure your WXWIN variable is set, and uses the FAT (short
274 name) form.
2752. Edit setup.h and set wxUSE_DRAG_AND_DROP to 0.
2763. Change directory to wx\src\msw. Type 'make -f makefile.sc' to
277 make the wxWindows core library.
2784. Change directory to wx\samples\minimal and type 'make -f makefile.sc'
279 to make this sample.
280
281Note: the minimal sample doesn't link properly ('Error: no
282start address').
28332-bit compilation only (partially) supported at present, using SC++ 6.1.
284Some functionality is missing using this compiler (see makefile).
285Add -D__WIN95__ if your SC++ has Windows 95 support, and ignore
286Step (2). 16-bit compilation is left as an excercise for the user!
287
ce3ed50d
JS
288Salford C++ compilation
289-----------------------
290
2911. Make sure your WXWIN variable is set, and uses the FAT (short
292 name) form.
2932. Edit SALFORDDIR and RESOURCEDIR in src/makesl.env as per
294 notes.
2953. Change directory to wx\src\msw. Type 'mk32 -f makefile.sl all' to
296 make the wxWindows core library.
2974. Change directory to wx\samples\minimal and type 'mk32 -f makefile.sl'
298 to make this sample.
299
300Unfortunately, Salford C++ seems to have problems with its code generation for
301operations on objects, as seen in wxFrame::OnMenuHighlight
302(minimal sample) or wxWindow::SetValidator (mdi sample). Also the
303the debugging version of the library is 90MB, with samples coming in
304at 40MB :-) However, wxWindows at least makes a good test suite for
305improving the compiler.
306
8870c26e
JS
307Cygwin b19/b20/Mingw32 compilation
308----------------------------------
2bda0e17 309
4c0a2c5c 310wxWindows 2 supports Cygwin (formerly GnuWin32) b19, b20, Mingw32, and Mingw32/EGCS.
2bda0e17
KB
311
312Thanks are due to Keith Garry Boyce (garp@opustel.com) and Cygnus for making
313it all possible.
314
8870c26e
JS
315From wxWindows 2.0 beta 9, both Cygwin and Mingw32 (the minimal
316distribution of Cygwin) can be used with the same makefiles.
2bda0e17
KB
317
318Here are the steps required:
319
8870c26e 320- Retrieve and install the latest beta of Cygwin, or Mingw32, as per the
2bda0e17
KB
321 instructions with either of these packages.
322
323- If using Mingw32 (including the EGCS variant), you need some
324 extra files to use the wxWindows makefiles. You can find these
325 files in ports/mingw32 on the ftp site or CD-ROM, as extra.zip.
326 These should be extracted to the Mingw32 directory.
8870c26e
JS
327 If you have already have downloaded bison, flex, make, rm, mv
328 from elsewhere, you won't need this.
329
4c0a2c5c
JS
330 If using Mingw32 2.8.1, see also see mingw32.txt in this directory
331 (docs/msw) about a fix that has to be applied to a Mingw32 header file.
332
333 If using Mingw32 2.95 with wxWindows 2.1 or above, and wish to use OLE, you
334 should hand-patch in Mingw32-gcc295.patches (located in the top-level of the
335 wxWindows 2 installation).
2bda0e17
KB
336
337- Modify the file wx/src/cygnus.bat (or mingw32.bat or mingegcs.bat)
338 to set up appropriate variables, if necessary mounting drives.
339 Run it before compiling.
340
8870c26e 341- For Cygwin, make sure there's a \tmp directory on your
2bda0e17
KB
342 Windows drive or bison will crash.
343
4c0a2c5c
JS
344- Edit wx/src/makeg95.env and set the MINGW32 variable at the top of
345 the file to either 1 (you have Mingw32) or 0 (you have Cygwin32).
1a7f3062
JS
346 If using MINGW32, also set the MINGW32VERSION variable
347 appropriately.
2bda0e17 348
4c0a2c5c
JS
349- Mingw32 may not support winsock.h, so if you have a problem
350 here, comment out socket-related files in src/msw/makefile.g95.
4fabb575 351
dbda9e86 352- Set your WXWIN variable to where wxWindows is installed.
25889d3c
JS
353 *** IMPORTANT: For Cygwin/Mingw32, use forward slashes in the path, not
354 backslashes.
dbda9e86 355
2bda0e17
KB
356- Use the makefile.g95 files for compiling wxWindows and samples,
357 e.g.:
358 > cd c:\wx\src\msw
359 > make -f makefile.g95
360 > cd c:\wx\samples\minimal
361 > make -f makefile.g95
362
cba2db0c
JS
363 Ignore the warning about the default entry point.
364
2bda0e17
KB
365- Use the 'strip' command to reduce executable size.
366
8870c26e 367- With Cygnus Cygwin, you can invoke gdb --nw myfile.exe to
4fabb575
JS
368 debug an executable. If there are memory leaks, they will be
369 flagged when the program quits.
2bda0e17
KB
370
371- If using GnuWin32 b18, you will need to copy windres.exe
372 from e.g. the Mingw32 distribution, to a directory in your path.
373
374All targets have 'clean' targets to allow removal of object files
375and other intermediate compiler files.
376
7c5dc04f 377Notes:
2bda0e17 378
74e34480 379- libwx.a is 48 MB or more - but much less if compiled with no
bb6290e3 380 debug info (-g0) and level 4 optimization (-O4).
7c5dc04f 381
2bda0e17 382- install.exe doesn't have built-in decompression because lzexpand.lib
8870c26e 383 isn't available with Cygwin. However, you can use it with external
2bda0e17 384 decompression utilities.
7c5dc04f 385
27529614 386- Doesn't compile src/msw/ole files, so no drag and drop.
2bda0e17 387
ad556aa9 388- There's a bug in Mingw32 headers for some early distributions.
7c5dc04f
JS
389
390 in include/windows32/defines.h, where it says:
391
392 #define LPSTR_TEXTCALLBACKA (LPSTR)-1L)
393
394 it should say:
395
396 #define LPSTR_TEXTCALLBACKA ((LPSTR)-1L)
397
398 (a missing bracket).
399
51babd09
JS
400- If there's a problem with the copy command in
401 src/msw/makefile.g95, you may need to change the relevant
402 section to the following:
403
404 COPY = command /c copy
405 $(COMMDIR)/y_tab.c: $(COMMDIR)/dosyacc.c
406 $(COPY) ..\\common\\dosyacc.c ..\\common\\y_tab.c
407
408 $(COMMDIR)/lex_yy.c: $(COMMDIR)/doslex.c
409 $(COPY) ..\\common\\doslex.c ..\\common\\lex_yy.c
410
2bda0e17
KB
411References:
412
413 - The GNU-WIN32 site is at
414 http://www.cygnus.com/gnu-win32/
415 - Mingw32 is available at:
b4fe5125 416 ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95/
2bda0e17
KB
417 - See also http://web.ukonline.co.uk/julian.smart/wxwin/gnuwin32.htm
418
57c208c5
JS
419TWIN32 and gcc on Linux
420-----------------------
421
422The wxWindows 2 for Windows port may be compiled using
423the TWIN32 emulator package from www.willows.com. However,
424TWIN32 is by no means finished so this should be taken as
425something to think about for the future, rather than
426a tool for writing products with.
427
428Use makefile.twn in much the same way as makefile.g95, as
429described above. Not all sample makefiles are supplied yet.
430
8870c26e
JS
431For some reason, I found I had to copy TWIN32's Windows resource
432compiler (rc) to the current working directory for it to be found.
433
434General Notes
435-------------
a0a302dc
JS
436
437- Debugging: under Windows 95, debugging output isn't output in
438 the same way that it is under NT or Windows 3.1. Set
439 wxUSE_DBWIN32 to 1 if you wish to enable code to output debugging
440 info to an external debug monitor, such as Andrew Tucker's DBWIN32.
441 You can download DBWIN32 from:
442
443 http://ftp.digital.com/pub/micro/NT/WinSite/programr/dbwin32.zip
444
2b556e9a 445 and it's also on the wxWindows CD-ROM under Packages.
62448488 446
e3065973
JS
447- If you are installing wxWindows 2 from CVS, you may find that
448 include/wx/msw/setup.h is missing. This is deliberate, to avoid
449 developers' different setup.h configurations getting confused.
450 Please copy setup0.h to setup.h before compiling.