]> git.saurik.com Git - wxWidgets.git/blame - docs/msw/install.txt
more files to ignore in cvs commands (setup.h, lex_yy.c, y_tab.c)
[wxWidgets.git] / docs / msw / install.txt
CommitLineData
2bda0e17
KB
1
2Installing wxWindows 2.0
3------------------------
4
5Unarchiving
6-----------
7
8If there is a setup program, run the setup program that comes with the Windows version.
9Do not install into a path that contains spaces. The installation program should set the
10WXWIN environment variable, which will be activated when your machine is rebooted.
11
12If there is no setup program, it will come as a series of .zip
13files:
14
15wx200gen.zip Generic source code and samples (required)
16wx200msw.zip Windows-specific source code and samples (required)
17wx200doc.zip Documentation source code (not required)
18wx200hlp.zip WinHelp documentation
2bda0e17
KB
19wx200pdf.zip Acrobat PDF documentation
20wx200htm.zip HTML documentation
a367b9b3 21wx200vc.zip MS VC++ 5.0 project files
3b1de9c2 22wx200cw.zip Metrowerks CodeWarrior project files
2bda0e17
KB
23
24Unarchive the required files plus any optional documentation
25files into a suitable directory such as c:\wx. Alter your
26WXWIN environment variable to point to this directory.
27
8870c26e
JS
28Other 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
2bda0e17
KB
35Compilation
36-----------
37
4fabb575 38At present, wxWindows compiles with VC++ 4.0/5.0/6.0,
8870c26e 39BC++ 4.5/5.0, Cygwin b19/b20, and Mingw32. It may compile
4fabb575
JS
40with 16-bit compilers (BC++ and VC++ 1.5) but this hasn't
41been tested lately.
2bda0e17 42
4fabb575
JS
43Visual C++ 4.0/5.0/6.0 compilation
44----------------------------------
2bda0e17 45
a367b9b3
JS
46Using project files:
47
481. Unarchive wx200vc.zip, the VC++ 5 project makefiles.
492. Open src/wxvc.dsp, set Debug or Release configuration, and
50 compile. This will produce lib/wxvc.lib or lib/wxvc_debug.lib.
513. Open a sample project file, choose a configuration, and compile.
16553659
JS
52 The project files don't use precompiled headers, to save
53 space, but you can switch PCH compiling on for greater speed.
a367b9b3
JS
54
55Using makefiles:
56
62448488 571. Make sure your WXWIN variable is set.
48d1144b 582. Change directory to wx\src\msw. Type 'nmake -f makefile.vc' to
2bda0e17 59 make the wxWindows core library.
48d1144b 603. Change directory to wx\samples and type 'nmake -f makefile.vc'
2bda0e17
KB
61 to make all the samples. You can also make them individually.
62
e2a6f233
JS
63To build the release version using makefiles, add FINAL=1 to your
64nmake invocation, both when building the library and for samples.
65
66Use the 'clean' target to clean all objects, libraries and
67executables.
68
69To build the DLL version using makefiles:
70
711. 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.
742. Invoke a sample makefile with 'nmake -f makefile.vc WXUSINGDLL=1'.
75
3f1af920 76Note (1): if you wish to use templates, please edit
025e88c5
JS
77include\wx\msw\setup.h and set wxUSE_DEBUG_NEW_ALWAYS to 0.
78Without this, the redefinition of 'new' will cause problems in
79the headers. Alternatively, #undef new before including template headers.
80
3f1af920
JS
81Note (2): libraries and applications generated with makefiles and
82project files are unlikely to be compatible, so use one method or
83the other.
84
2bda0e17
KB
85Visual C++ 1.5 compilation
86--------------------------
87
62448488
JS
881. Make sure your WXWIN variable is set, and uses the FAT (short
89 name) form.
902. Change directory to wx\src\msw. Type 'nmake -f makefile.dos' to
2bda0e17 91 make the wxWindows core library.
62448488 923. Change directory to a sample, such as wx\samples\minimal, and
f60d0f94 93 type 'nmake -f makefile.dos'.
2bda0e17 94
e2a6f233
JS
95Add FINAL=1 to your makefile invocation to build the release
96versions of the library and samples.
97
98Use the 'clean' target to clean all objects, libraries and
99executables.
100
2bda0e17
KB
101Borland C++ 4.5/5.0 compilation
102-------------------------------
103
62448488
JS
1041. Make sure your WXWIN variable is set, and uses the FAT (short
105 name) form if doing a 16-bit compile.
1062. 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.
1093. Change directory to a sample such as minimal, and type
110 'make -f makefile.b32'.
4bf78aae
JS
1114. 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.
62448488 115
3b1de9c2
JS
116Note: the wxWindows library and (some) samples compile in 16-bit mode
117using makefile.bcc, but at present the wxWindows resource system is switched
118off in this mode. See issues.txt for details.
2bda0e17 119
4bf78aae
JS
120Borland C++Builder compilation
121------------------------------
122
123C++Builder compilation is the same as for Borland C++ above.
3f1af920
JS
124
125Tested with C++Builder 1.0 and 3.0. Only makefiles are currently
126supplied.
4bf78aae 127
7be1f0d9
JS
128Watcom C++ 10.6 compilation
129---------------------------
130
62448488
JS
1311. Make sure your WXWIN variable is set, and uses the FAT (short
132 name) form.
1332. Change directory to wx\src\msw. Type 'wmake -f makefile.wat' to
7be1f0d9 134 make the wxWindows core library.
62448488 1353. Change directory to wx\samples\minimal and type 'wmake -f makefile.wat'
8a2c6ef8 136 to make this sample.
7be1f0d9 137
62448488
JS
138Metrowerks CodeWarrior compilation
139----------------------------------
140
3b1de9c2
JS
1411. Downloaded and unzip wx200cw.zip.
1422. Load the make_cw.mcp project in wx\src, and compile.
1433. 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.
62448488 146
0a240683
JS
147NOTES:
148
149(a) Unfortunately CodeWarrior support is broken in this
150release. Stefan Csomor (csomor@advancedconcepts.ch) will rectify this shortly.
151(b) You need CodeWarrior Pro 4 plus the patches to 4.1 from the
152Metrowerks Web site.
153
3f1af920
JS
154Symantec C++ compilation
155------------------------
156
1571. Make sure your WXWIN variable is set, and uses the FAT (short
158 name) form.
1592. Edit setup.h and set wxUSE_DRAG_AND_DROP to 0.
1603. Change directory to wx\src\msw. Type 'make -f makefile.sc' to
161 make the wxWindows core library.
1624. Change directory to wx\samples\minimal and type 'make -f makefile.sc'
163 to make this sample.
164
165Note: the minimal sample doesn't link properly ('Error: no
166start address').
16732-bit compilation only (partially) supported at present, using SC++ 6.1.
168Some functionality is missing using this compiler (see makefile).
169Add -D__WIN95__ if your SC++ has Windows 95 support, and ignore
170Step (2). 16-bit compilation is left as an excercise for the user!
171
ce3ed50d
JS
172Salford C++ compilation
173-----------------------
174
1751. Make sure your WXWIN variable is set, and uses the FAT (short
176 name) form.
1772. Edit SALFORDDIR and RESOURCEDIR in src/makesl.env as per
178 notes.
1793. Change directory to wx\src\msw. Type 'mk32 -f makefile.sl all' to
180 make the wxWindows core library.
1814. Change directory to wx\samples\minimal and type 'mk32 -f makefile.sl'
182 to make this sample.
183
184Unfortunately, Salford C++ seems to have problems with its code generation for
185operations on objects, as seen in wxFrame::OnMenuHighlight
186(minimal sample) or wxWindow::SetValidator (mdi sample). Also the
187the debugging version of the library is 90MB, with samples coming in
188at 40MB :-) However, wxWindows at least makes a good test suite for
189improving the compiler.
190
8870c26e
JS
191Cygwin b19/b20/Mingw32 compilation
192----------------------------------
2bda0e17 193
8870c26e 194wxWindows 2.0 supports Cygwin (formerly GnuWin32) b19, b20, Mingw32, and Mingw32/EGCS.
2bda0e17
KB
195
196Thanks are due to Keith Garry Boyce (garp@opustel.com) and Cygnus for making
197it all possible.
198
8870c26e
JS
199From wxWindows 2.0 beta 9, both Cygwin and Mingw32 (the minimal
200distribution of Cygwin) can be used with the same makefiles.
2bda0e17
KB
201
202Here are the steps required:
203
8870c26e 204- Retrieve and install the latest beta of Cygwin, or Mingw32, as per the
2bda0e17
KB
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.
8870c26e
JS
211 If you have already have downloaded bison, flex, make, rm, mv
212 from elsewhere, you won't need this.
213
a724d789
JS
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.
2bda0e17
KB
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
8870c26e 221- For Cygwin, make sure there's a \tmp directory on your
2bda0e17
KB
222 Windows drive or bison will crash.
223
224- Edit wx/src/makeg95.env and search for MINGW32. Take note of
8870c26e 225 the comments for adjusting settings to suit Cygwin or
2bda0e17 226 Mingw32. Basically, this is just a case of adding the __MINGW32__ symbol
8870c26e 227 to OPTIONS for Mingw32, or removing it for Cygnus Cygwin.
2bda0e17 228 For Mingw32/EGCS, add both __MINGW32__ and __EGCS__.
8870c26e
JS
229 You may need to remove -loldnames from WINLIBS for Mingw32, or add it for
230 Cygwin.
2bda0e17 231
4fabb575
JS
232- Mingw32 may not support winsock.h, so comment out
233 socket-related files in src/msw/makefile.g95.
234
2bda0e17
KB
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
8870c26e 244- With Cygnus Cygwin, you can invoke gdb --nw myfile.exe to
4fabb575
JS
245 debug an executable. If there are memory leaks, they will be
246 flagged when the program quits.
2bda0e17
KB
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
251All targets have 'clean' targets to allow removal of object files
252and other intermediate compiler files.
253
254Gotchas:
255
74e34480 256- libwx.a is 48 MB or more - but much less if compiled with no
bb6290e3 257 debug info (-g0) and level 4 optimization (-O4).
2bda0e17 258- install.exe doesn't have built-in decompression because lzexpand.lib
8870c26e 259 isn't available with Cygwin. However, you can use it with external
2bda0e17 260 decompression utilities.
27529614 261- Doesn't compile src/msw/ole files, so no drag and drop.
2bda0e17
KB
262
263References:
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
57c208c5
JS
271TWIN32 and gcc on Linux
272-----------------------
273
274The wxWindows 2 for Windows port may be compiled using
275the TWIN32 emulator package from www.willows.com. However,
276TWIN32 is by no means finished so this should be taken as
277something to think about for the future, rather than
278a tool for writing products with.
279
280Use makefile.twn in much the same way as makefile.g95, as
281described above. Not all sample makefiles are supplied yet.
282
8870c26e
JS
283For some reason, I found I had to copy TWIN32's Windows resource
284compiler (rc) to the current working directory for it to be found.
285
286General Notes
287-------------
a0a302dc
JS
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
2b556e9a 297 and it's also on the wxWindows CD-ROM under Packages.
62448488 298
e3065973
JS
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.