]> git.saurik.com Git - wxWidgets.git/blob - docs/msw/install.txt
Removed lots of OnClose functions; doc'ed OnCloseWindow better;
[wxWidgets.git] / docs / msw / install.txt
1
2 Installing wxWindows 2.0
3 ------------------------
4
5 Unarchiving
6 -----------
7
8 If there is a setup program, run the setup program that comes with the Windows version.
9 Do not install into a path that contains spaces. The installation program should set the
10 WXWIN environment variable, which will be activated when your machine is rebooted.
11
12 If there is no setup program, it will come as a series of .zip
13 files:
14
15 wx200gen.zip Generic source code and samples (required)
16 wx200msw.zip Windows-specific source code and samples (required)
17 wx200doc.zip Documentation source code (not required)
18 wx200hlp.zip WinHelp documentation
19 wx200pdf.zip Acrobat PDF documentation
20 wx200htm.zip HTML documentation
21 wx200vc.zip MS VC++ 5.0 project files
22 wx200cw.zip Metrowerks CodeWarrior project files
23
24 Unarchive the required files plus any optional documentation
25 files into a suitable directory such as c:\wx. Alter your
26 WXWIN environment variable to point to this directory.
27
28 Other add-on packages are available from the wxWindows Web site, such as:
29
30 - glcanvas.zip. Use OpenGL in a wxWindows window.
31 - ogl3.zip. Object Graphics Library: build network diagrams, CASE tools etc.
32 - tex2rtf3.zip. Tex2RTF: create Windows Help, HTML, and Word RTF files from
33 the same document source.
34
35 Compilation
36 -----------
37
38 At present, wxWindows compiles with VC++ 4.0/5.0/6.0,
39 BC++ 4.5/5.0, Cygwin b19/b20, and Mingw32. It may compile
40 with 16-bit compilers (BC++ and VC++ 1.5) but this hasn't
41 been tested lately.
42
43 Visual C++ 4.0/5.0/6.0 compilation
44 ----------------------------------
45
46 Using project files:
47
48 1. Unarchive wx200vc.zip, the VC++ 5 project makefiles.
49 2. Open src/wxvc.dsp, set Debug or Release configuration, and
50 compile. This will produce lib/wxvc.lib or lib/wxvc_debug.lib.
51 3. Open a sample project file, choose a configuration, and compile.
52 The project files don't use precompiled headers, to save
53 space, but you can switch PCH compiling on for greater speed.
54
55 Using makefiles:
56
57 1. Make sure your WXWIN variable is set.
58 2. Change directory to wx\src\msw. Type 'nmake -f makefile.vc' to
59 make the wxWindows core library.
60 3. Change directory to wx\samples and type 'nmake -f makefile.vc'
61 to make all the samples. You can also make them individually.
62
63 To build the release version using makefiles, add FINAL=1 to your
64 nmake invocation, both when building the library and for samples.
65
66 Use the 'clean' target to clean all objects, libraries and
67 executables.
68
69 To build the DLL version using makefiles:
70
71 1. Change directory to wx\src\msw. Type 'nmake -f makefile.vc dll pch'
72 to make both a suitable DLL and import library, and to build a
73 suitable precompiled header file for compiling applications.
74 2. Invoke a sample makefile with 'nmake -f makefile.vc WXUSINGDLL=1'.
75
76 Note (1): if you wish to use templates, please edit
77 include\wx\msw\setup.h and set wxUSE_DEBUG_NEW_ALWAYS to 0.
78 Without this, the redefinition of 'new' will cause problems in
79 the headers. Alternatively, #undef new before including template headers.
80
81 Note (2): libraries and applications generated with makefiles and
82 project files are unlikely to be compatible, so use one method or
83 the other.
84
85 Visual C++ 1.5 compilation
86 --------------------------
87
88 1. Make sure your WXWIN variable is set, and uses the FAT (short
89 name) form.
90 2. Change directory to wx\src\msw. Type 'nmake -f makefile.dos' to
91 make the wxWindows core library.
92 3. Change directory to a sample, such as wx\samples\minimal, and
93 type 'nmake -f makefile.dos'.
94
95 Add FINAL=1 to your makefile invocation to build the release
96 versions of the library and samples.
97
98 Use the 'clean' target to clean all objects, libraries and
99 executables.
100
101 Borland C++ 4.5/5.0 compilation
102 -------------------------------
103
104 1. Make sure your WXWIN variable is set, and uses the FAT (short
105 name) form if doing a 16-bit compile.
106 2. Change directory to wx\src\msw. Type 'make -f makefile.b32' to
107 make the wxWindows core library. Ignore the warnings about
108 'XXX' not found in library.
109 3. Change directory to a sample such as minimal, and type
110 'make -f makefile.b32'.
111 4. For release versions, recompile wxWindows and samples using
112 'make -f makefile.b32 clean'
113 'make -f makefile.b32 FINAL=1'
114 for the library and samples.
115
116 Note: the wxWindows library and (some) samples compile in 16-bit mode
117 using makefile.bcc, but at present the wxWindows resource system is switched
118 off in this mode. See issues.txt for details.
119
120 Borland C++Builder compilation
121 ------------------------------
122
123 C++Builder compilation is the same as for Borland C++ above.
124
125 Tested with C++Builder 1.0 and 3.0. Only makefiles are currently
126 supplied.
127
128 Watcom C++ 10.6 compilation
129 ---------------------------
130
131 1. Make sure your WXWIN variable is set, and uses the FAT (short
132 name) form.
133 2. Change directory to wx\src\msw. Type 'wmake -f makefile.wat' to
134 make the wxWindows core library.
135 3. Change directory to wx\samples\minimal and type 'wmake -f makefile.wat'
136 to make this sample.
137
138 Metrowerks CodeWarrior compilation
139 ----------------------------------
140
141 1. Downloaded and unzip wx200cw.zip.
142 2. Load the make_cw.mcp project in wx\src, and compile.
143 3. Load the make_cw.mcp project in wx\samples\minimal, and compile.
144 Further project files for samples will be available in due
145 course.
146
147 NOTES:
148
149 (a) Unfortunately CodeWarrior support is broken in this
150 release. Stefan Csomor (csomor@advancedconcepts.ch) will rectify this shortly.
151 (b) You need CodeWarrior Pro 4 plus the patches to 4.1 from the
152 Metrowerks Web site.
153
154 Symantec C++ compilation
155 ------------------------
156
157 1. Make sure your WXWIN variable is set, and uses the FAT (short
158 name) form.
159 2. Edit setup.h and set wxUSE_DRAG_AND_DROP to 0.
160 3. Change directory to wx\src\msw. Type 'make -f makefile.sc' to
161 make the wxWindows core library.
162 4. Change directory to wx\samples\minimal and type 'make -f makefile.sc'
163 to make this sample.
164
165 Note: the minimal sample doesn't link properly ('Error: no
166 start address').
167 32-bit compilation only (partially) supported at present, using SC++ 6.1.
168 Some functionality is missing using this compiler (see makefile).
169 Add -D__WIN95__ if your SC++ has Windows 95 support, and ignore
170 Step (2). 16-bit compilation is left as an excercise for the user!
171
172 Salford C++ compilation
173 -----------------------
174
175 1. Make sure your WXWIN variable is set, and uses the FAT (short
176 name) form.
177 2. Edit SALFORDDIR and RESOURCEDIR in src/makesl.env as per
178 notes.
179 3. Change directory to wx\src\msw. Type 'mk32 -f makefile.sl all' to
180 make the wxWindows core library.
181 4. Change directory to wx\samples\minimal and type 'mk32 -f makefile.sl'
182 to make this sample.
183
184 Unfortunately, Salford C++ seems to have problems with its code generation for
185 operations on objects, as seen in wxFrame::OnMenuHighlight
186 (minimal sample) or wxWindow::SetValidator (mdi sample). Also the
187 the debugging version of the library is 90MB, with samples coming in
188 at 40MB :-) However, wxWindows at least makes a good test suite for
189 improving the compiler.
190
191 Cygwin b19/b20/Mingw32 compilation
192 ----------------------------------
193
194 wxWindows 2.0 supports Cygwin (formerly GnuWin32) b19, b20, Mingw32, and Mingw32/EGCS.
195
196 Thanks are due to Keith Garry Boyce (garp@opustel.com) and Cygnus for making
197 it all possible.
198
199 From wxWindows 2.0 beta 9, both Cygwin and Mingw32 (the minimal
200 distribution of Cygwin) can be used with the same makefiles.
201
202 Here are the steps required:
203
204 - Retrieve and install the latest beta of Cygwin, or Mingw32, as per the
205 instructions with either of these packages.
206
207 - If using Mingw32 (including the EGCS variant), you need some
208 extra files to use the wxWindows makefiles. You can find these
209 files in ports/mingw32 on the ftp site or CD-ROM, as extra.zip.
210 These should be extracted to the Mingw32 directory.
211 If you have already have downloaded bison, flex, make, rm, mv
212 from elsewhere, you won't need this.
213
214 IMPORTANT: also see mingw32.txt in this directory (docs/msw)
215 about a fix that has to be applied to a Mingw32 header file.
216
217 - Modify the file wx/src/cygnus.bat (or mingw32.bat or mingegcs.bat)
218 to set up appropriate variables, if necessary mounting drives.
219 Run it before compiling.
220
221 - For Cygwin, make sure there's a \tmp directory on your
222 Windows drive or bison will crash.
223
224 - Edit wx/src/makeg95.env and search for MINGW32. Take note of
225 the comments for adjusting settings to suit Cygwin or
226 Mingw32. Basically, this is just a case of adding the __MINGW32__ symbol
227 to OPTIONS for Mingw32, or removing it for Cygnus Cygwin.
228 For Mingw32/EGCS, add both __MINGW32__ and __EGCS__.
229 You may need to remove -loldnames from WINLIBS for Mingw32, or add it for
230 Cygwin.
231
232 - Mingw32 may not support winsock.h, so comment out
233 socket-related files in src/msw/makefile.g95.
234
235 - Use the makefile.g95 files for compiling wxWindows and samples,
236 e.g.:
237 > cd c:\wx\src\msw
238 > make -f makefile.g95
239 > cd c:\wx\samples\minimal
240 > make -f makefile.g95
241
242 - Use the 'strip' command to reduce executable size.
243
244 - With Cygnus Cygwin, you can invoke gdb --nw myfile.exe to
245 debug an executable. If there are memory leaks, they will be
246 flagged when the program quits.
247
248 - If using GnuWin32 b18, you will need to copy windres.exe
249 from e.g. the Mingw32 distribution, to a directory in your path.
250
251 All targets have 'clean' targets to allow removal of object files
252 and other intermediate compiler files.
253
254 Gotchas:
255
256 - libwx.a is 48 MB or more - but much less if compiled with no
257 debug info (-g0) and level 4 optimization (-O4).
258 - install.exe doesn't have built-in decompression because lzexpand.lib
259 isn't available with Cygwin. However, you can use it with external
260 decompression utilities.
261 - Doesn't compile src/msw/ole files, so no drag and drop.
262
263 References:
264
265 - The GNU-WIN32 site is at
266 http://www.cygnus.com/gnu-win32/
267 - Mingw32 is available at:
268 http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/index.html
269 - See also http://web.ukonline.co.uk/julian.smart/wxwin/gnuwin32.htm
270
271 TWIN32 and gcc on Linux
272 -----------------------
273
274 The wxWindows 2 for Windows port may be compiled using
275 the TWIN32 emulator package from www.willows.com. However,
276 TWIN32 is by no means finished so this should be taken as
277 something to think about for the future, rather than
278 a tool for writing products with.
279
280 Use makefile.twn in much the same way as makefile.g95, as
281 described above. Not all sample makefiles are supplied yet.
282
283 For some reason, I found I had to copy TWIN32's Windows resource
284 compiler (rc) to the current working directory for it to be found.
285
286 General Notes
287 -------------
288
289 - Debugging: under Windows 95, debugging output isn't output in
290 the same way that it is under NT or Windows 3.1. Set
291 wxUSE_DBWIN32 to 1 if you wish to enable code to output debugging
292 info to an external debug monitor, such as Andrew Tucker's DBWIN32.
293 You can download DBWIN32 from:
294
295 http://ftp.digital.com/pub/micro/NT/WinSite/programr/dbwin32.zip
296
297 and it's also on the wxWindows CD-ROM under Packages.
298
299 - If you are installing wxWindows 2 from CVS, you may find that
300 include/wx/msw/setup.h is missing. This is deliberate, to avoid
301 developers' different setup.h configurations getting confused.
302 Please copy setup0.h to setup.h before compiling.