]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/msw/install.txt
correction for Mac OS X compilation
[wxWidgets.git] / docs / msw / install.txt
... / ...
CommitLineData
1
2Installing wxWindows 2.3
3------------------------
4
5This is wxWindows 2.3 for Microsoft Windows 3.1, 95, 98 and
6Windows NT/Windows 2000. This is an unstable development 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, 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/patches/#freecompiler55
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.
415
416Metrowerks CodeWarrior compilation
417----------------------------------
418
4191. Downloaded and unzip wxWindows-x.y.z-cw.zip.
4202. Load the make_cw.mcp project in wx\src, and compile.
4213. Load the make_cw.mcp project in wx\samples\minimal, and compile.
422 Further project files for samples will be available in due
423 course.
424
425Note (1): you need CodeWarrior Pro 4 plus the patches to 4.1 from the
426Metrowerks Web site.
427
428Note (2): unfortunately these files are not yet up-to-date for the
429current release.
430
431Symantec C++ compilation
432------------------------
433
4341. Make sure your WXWIN variable is set, and uses the FAT (short
435 name) form.
4362. Edit setup.h and set wxUSE_DRAG_AND_DROP to 0.
4373. Change directory to wx\src\msw. Type 'make -f makefile.sc' to
438 make the wxWindows core library.
4394. Change directory to wx\samples\minimal and type 'make -f makefile.sc'
440 to make this sample.
441
442Note: the minimal sample doesn't link properly ('Error: no
443start address').
44432-bit compilation only (partially) supported at present, using SC++ 6.1.
445Some functionality is missing using this compiler (see makefile).
446Add -D__WIN95__ if your SC++ has Windows 95 support, and ignore
447Step (2). 16-bit compilation is left as an excercise for the user!
448
449Salford C++ compilation
450-----------------------
451
4521. Make sure your WXWIN variable is set, and uses the FAT (short
453 name) form.
4542. Edit SALFORDDIR and RESOURCEDIR in src/makesl.env as per
455 notes.
4563. Change directory to wx\src\msw. Type 'mk32 -f makefile.sl all' to
457 make the wxWindows core library.
4584. Change directory to wx\samples\minimal and type 'mk32 -f makefile.sl'
459 to make this sample.
460
461Unfortunately, Salford C++ seems to have problems with its code generation for
462operations on objects, as seen in wxFrame::OnMenuHighlight
463(minimal sample) or wxWindow::SetValidator (mdi sample). Also the
464the debugging version of the library is 90MB, with samples coming in
465at 40MB :-) However, wxWindows at least makes a good test suite for
466improving the compiler.
467
468Cygwin/Mingw32 compilation
469----------------------------------
470
471wxWindows 2 supports Cygwin (formerly GnuWin32) betas and
472releases, and Mingw32.
473
474Thanks are due to Keith Garry Boyce (garp@opustel.com), Cygnus
475and others for making it all possible.
476
477Both Cygwin and Mingw32 (the minimal distribution of Cygwin) can be used
478with the same makefiles.
479
480Here are the steps required:
481
482- Retrieve and install the latest beta of Cygwin, or Mingw32, as per the
483 instructions with either of these packages.
484
485- If using Mingw32, you need some extra files to use the wxWindows
486 makefiles. You can find these files in ports/mingw32 on the
487 wxWindows ftp site or CD-ROM, as extra.zip. These should be extracted
488 to the Mingw32 directory. If you have alread downloaded rm, cp, mv
489 from elsewhere, you won't need this.
490
491 If using Mingw32 2.95 and below with wxWindows 2.1 or above, you
492 must hand-patch with Mingw32-gcc295.patches (located in the
493 top-level of the wxWindows 2 installation). Mingw32 2.95.2
494 and above contain the fixes already.
495
496- Modify the file wx/src/cygnus.bat (or mingw32.bat or mingegcs.bat)
497 to set up appropriate variables, if necessary mounting drives.
498 Run it before compiling.
499
500- For Cygwin, make sure there's a \tmp directory on your
501 Windows drive or bison will crash (actually you don't need
502 bison for ordinary wxWindows compilation: a pre-generated .c file is
503 supplied).
504
505- Edit wx/src/makeg95.env and set the MINGW32 variable at the top of
506 the file to either 1 (you have Mingw32 or Cygwin 1.x releases) or 0
507 (if you have Cygwin betas). If using Mingw32, also set the
508 MINGW32VERSION variable appropriately.
509
510- Set your WXWIN variable to where wxWindows is installed.
511 *** IMPORTANT: For Cygwin/Mingw32, use forward slashes in the path, not
512 backslashes.
513
514- Use the makefile.g95 files for compiling wxWindows and samples,
515 e.g.:
516 > cd c:\wx\src\msw
517 > make -f makefile.g95
518 > cd c:\wx\samples\minimal
519 > make -f makefile.g95
520
521 Ignore the warning about the default entry point.
522
523- Use the 'strip' command to reduce executable size.
524
525- With Cygwin, you can invoke gdb --nw myfile.exe to
526 debug an executable. If there are memory leaks, they will be
527 flagged when the program quits.
528
529- If using GnuWin32 b18, you will need to copy windres.exe
530 from e.g. the Mingw32 distribution, to a directory in your path.
531
532All targets have 'clean' targets to allow removal of object files
533and other intermediate compiler files.
534
535Notes:
536
5371. See also the Cygwin/Mingw32 on the web site or CD-ROM for
538 further information about using wxWindows with these compilers.
539
5402. libwx.a is 48 MB or more - but much less if compiled with no
541 debug info (-g0) and level 4 optimization (-O4).
542
5433. There's a bug in Mingw32 headers for some early distributions.
544
545 in include/windows32/defines.h, where it says:
546
547 #define LPSTR_TEXTCALLBACKA (LPSTR)-1L)
548
549 it should say:
550
551 #define LPSTR_TEXTCALLBACKA ((LPSTR)-1L)
552
553 (a missing bracket).
554
5554. If there's a problem with the copy or remove commands in
556 src/msw/makefile.g95, you may need to change the COPY and
557 RM variables in makeg95.env.
558
5595. If there's a problem executing the windres program, try
560 commenting out RCPREPROCESSOR in makeg95.env.
561
5626. OpenGL support should work with Mingw32 as-is. However,
563 if you wish to generate import libraries appropriate either for
564 the MS OpenGL libraries or the SGI OpenGL libraries, go to
565 include/wx/msw/gl and use:
566
567 dlltool -k -d opengl.def -llibopengl.a
568
569 for the SGI DLLs, or
570
571 dlltool -k -d opengl32.def -llibopengl32.a
572
573 and similarly for glu[32].def.
574
575References:
576
577 - The Cygwin site is at
578 http://sourceware.cygnus.com
579 - Mingw32 is available at:
580 ftp://www.mingw.org
581
582TWIN32 and gcc on Linux
583-----------------------
584
585The wxWindows 2 for Windows port may be compiled using
586the TWIN32 emulator package from www.willows.com. However,
587TWIN32 is by no means finished so this should be taken as
588something to think about for the future, rather than
589a tool for writing products with.
590
591Use makefile.twn in much the same way as makefile.g95, as
592described above. Not all sample makefiles are supplied yet.
593
594For some reason, I found I had to copy TWIN32's Windows resource
595compiler (rc) to the current working directory for it to be found.
596
597General Notes
598-------------
599
600- Debugging: under Windows 95, debugging output isn't output in
601 the same way that it is under NT or Windows 3.1.
602 Please see DebugView (bin/dbgview.exe in the distribution), also
603 available from http://www.sysinternals.com and on the wxWindows CD-ROM
604 under Packages.
605
606- If you are installing wxWindows 2 from CVS, you may find that
607 include/wx/msw/setup.h is missing. This is deliberate, to avoid
608 developers' different setup.h configurations getting confused.
609 Please copy setup0.h to setup.h before compiling. Also, read
610 the BuildCVS.txt for other hints.
611