]>
Commit | Line | Data |
---|---|---|
2bda0e17 | 1 | |
fb1bd1bd | 2 | Installing wxWindows 2.3 |
0544bc0a RR |
3 | ------------------------ |
4 | ||
fb1bd1bd | 5 | This is wxWindows 2.3 for Microsoft Windows 3.1, 95, 98 and |
940718f0 | 6 | Windows NT/Windows 2000. This is an unstable development release. |
0544bc0a | 7 | |
dbda9e86 | 8 | IMPORTANT NOTE: If you experience problems installing, please |
9c6751aa JS |
9 | re-read this instructions and other related files (changes.txt, |
10 | readme.txt, notes on the Web site) carefully before mailing | |
11 | wx-users or the author. Preferably, try to fix the problem first and | |
154f22b3 JS |
12 | then send a patch to the author. Please report bugs using the |
13 | bug report form on the wxWindows web site. | |
dbda9e86 | 14 | |
2bda0e17 KB |
15 | Unarchiving |
16 | ----------- | |
17 | ||
154f22b3 | 18 | A setup program is provided (setup.exe) to automatically copy files to a |
01dba85a JS |
19 | directory on your hard disk. Do not install into a path that contains spaces. |
20 | The installation program should set the WXWIN environment variable, which | |
21 | will be activated when your machine is rebooted. The setup | |
22 | program 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; | |
669f7a11 | 30 | - TIFF library source; |
01dba85a | 31 | - Object Graphics Library; |
01dba85a JS |
32 | - Tex2RTF source; |
33 | - Dialog Editor binary. | |
34 | ||
f6bcfd97 BP |
35 | Alternatively, you may unarchive the .zip form by hand: |
36 | wxMSW-x.y.z.zip where x.y.z is the version number. | |
2bda0e17 KB |
37 | |
38 | Unarchive the required files plus any optional documentation | |
dbda9e86 | 39 | files into a suitable directory such as c:\wx. |
2bda0e17 | 40 | |
8870c26e JS |
41 | Other add-on packages are available from the wxWindows Web site, such as: |
42 | ||
5d525ad9 | 43 | - mmedia.zip. Audio, CD, video access for Windows and Linux. |
8870c26e JS |
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 | ||
dbda9e86 JS |
48 | General installation notes |
49 | -------------------------- | |
50 | ||
51 | Alter your WXWIN environment variable to point to this directory. | |
52 | For Cygwin or Mingw32 compilation, make sure WXWIN contains only | |
53 | forward slashes. | |
54 | ||
55 | If installing from the CVS server, copy include/wx/msw/setup0.h to | |
f74ececa VZ |
56 | include/wx/msw/setup.h and edit the resulting file to choose the featrues you |
57 | would like to compile wxWindows with[out]. | |
dbda9e86 | 58 | |
2bda0e17 KB |
59 | Compilation |
60 | ----------- | |
61 | ||
dbda9e86 JS |
62 | The following sections explain how to compile wxWindows with each supported |
63 | compiler. | |
2bda0e17 | 64 | |
4fabb575 JS |
65 | Visual C++ 4.0/5.0/6.0 compilation |
66 | ---------------------------------- | |
2bda0e17 | 67 | |
5fa399c9 | 68 | Using project files (VC++ 5 and 6 only): |
a367b9b3 | 69 | |
f6bcfd97 BP |
70 | 1. 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). | |
5fa399c9 JS |
72 | 2. 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]. | |
81 | 3. 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 | |
16553659 | 84 | space, but you can switch PCH compiling on for greater speed. |
669f7a11 JS |
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. | |
a367b9b3 JS |
89 | |
90 | Using makefiles: | |
91 | ||
62448488 | 92 | 1. Make sure your WXWIN variable is set. |
d1e418ea JS |
93 | 2. 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. | |
97 | 3. Change directory to wx\src\msw. Type: | |
ca5c8b2d JS |
98 | |
99 | 'nmake -f makefile.vc' | |
100 | ||
101 | to make the wxWindows core library with debug information | |
7fee680b | 102 | (wx\lib\wxd.lib), then |
ca5c8b2d | 103 | |
7fee680b | 104 | 'nmake -f makefile.vc cleanall FINAL=1' |
ca5c8b2d JS |
105 | 'nmake -f makefile.vc FINAL=1' |
106 | ||
107 | to make the wxWindows core library without debug information | |
108 | (wx\lib\wx.lib). | |
85f3749f | 109 | 4. Change directory to wx\samples and type 'nmake -f makefile.vc' |
2bda0e17 KB |
110 | to make all the samples. You can also make them individually. |
111 | ||
5fa399c9 | 112 | Makefile notes: |
e2a6f233 | 113 | |
7fee680b | 114 | Use the 'cleanall' target to clean all objects, libraries and |
ca5c8b2d JS |
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. | |
7fee680b JS |
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. | |
ca5c8b2d JS |
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 | |
7fee680b | 129 | cleaned and re-made to build a different configuration. |
e2a6f233 JS |
130 | |
131 | To build the DLL version using makefiles: | |
132 | ||
133 | 1. 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. | |
ca5c8b2d JS |
136 | The resulting libraries are called: |
137 | ||
5fa399c9 JS |
138 | wx\lib\wx[version].lib(dll) (debug version) |
139 | wx\lib\wx[version].lib(dll) (release version, using FINAL=1) | |
ca5c8b2d JS |
140 | |
141 | 2. 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). | |
e2a6f233 | 144 | |
3f1af920 | 145 | Note (1): if you wish to use templates, please edit |
025e88c5 JS |
146 | include\wx\msw\setup.h and set wxUSE_DEBUG_NEW_ALWAYS to 0. |
147 | Without this, the redefinition of 'new' will cause problems in | |
148 | the headers. Alternatively, #undef new before including template headers. | |
dbda9e86 JS |
149 | You will also need to set wxUSE_IOSTREAMH to 0 if you will be |
150 | using templates, to avoid the non-template stream files being included | |
151 | within wxWindows. | |
025e88c5 | 152 | |
3f1af920 | 153 | Note (2): libraries and applications generated with makefiles and |
5fa399c9 JS |
154 | project files are now (hopefully) compatible where static libraries |
155 | are concerned, but please exercise caution nevertheless and if | |
156 | possible, use one method or the other. | |
3f1af920 | 157 | |
750b78ba | 158 | Note (3): VC++ 5's optimization code seems to be broken and can |
ad556aa9 JS |
159 | cause both compile and run-time problems: this can be seen when |
160 | deleting an object Dialog Editor, in Release mode with optimizations | |
161 | on. If in doubt, switch off optimisations, although this will result in much | |
750b78ba JS |
162 | larger executables. It seems possible that the library can be created with |
163 | strong optimization, so long as the application is not strongly | |
164 | optimized. For example, in wxWindows project, set to 'Minimum | |
165 | Size'. In Dialog Editor project, set to 'Customize: Favor Small | |
166 | Code' (and no others). This will then work. | |
167 | ||
6474416b JS |
168 | Similarly, in VC++ 4, optimization can cause internal compiler |
169 | errors, so edit src\makevc.env and change /O1 to /Od before | |
bf4d9b2b JS |
170 | trying build a release version of the library. Or, type: |
171 | ||
172 | nmake -f makefile.vc noopt FINAL=1 | |
173 | ||
174 | and then resume compilation in the normal way. This will build | |
7fee680b JS |
175 | troublesome files with no optimization. However, there now seems to be |
176 | an internal linker error using VC++ 4, in addition to internal | |
177 | compiler errors for most of the samples, so this version of the compiler | |
178 | cannot be recommended! | |
6474416b | 179 | |
ad813b00 JS |
180 | Note (4): some crash problems can be due to inconsistent compiler |
181 | options. If strange/weird/impossible things start to happen please | |
182 | check (dumping IDE project file as makefile and doing text comparison | |
183 | if necessary) that the project settings, especially the list of defined | |
184 | symbols, struct packing, etc. are exactly the same for all items in | |
185 | the project. After this, delete everything (including PCH) and recompile. | |
186 | ||
fac26663 JS |
187 | Note (5): for some further notes about upgrading your project |
188 | files to be compatible with wxWindows 2.1.14, please see | |
f6bcfd97 | 189 | "Highlights of wxWindows" from the Download page of the |
fac26663 JS |
190 | web site or CD-ROM. |
191 | ||
9c6751aa JS |
192 | Note (6): to create your own IDE files, see the technical note on the |
193 | wxWindows web site or CD-ROM, entitled "Compiling wxWindows | |
f6bcfd97 BP |
194 | applications in the VC++ IDE" (technical note docs/tech/tn0010.htm in the |
195 | wxWindows distribution). You can also copy .dsp and .dsw | |
9c6751aa JS |
196 | files from an existing wxWindows sample and adapt them. |
197 | ||
8fb3a512 JS |
198 | Visual C++ 1.5 compilation (16-bit) |
199 | ----------------------------------- | |
2bda0e17 | 200 | |
62448488 JS |
201 | 1. Make sure your WXWIN variable is set, and uses the FAT (short |
202 | name) form. | |
203 | 2. Change directory to wx\src\msw. Type 'nmake -f makefile.dos' to | |
2bda0e17 | 204 | make the wxWindows core library. |
62448488 | 205 | 3. Change directory to a sample, such as wx\samples\minimal, and |
f60d0f94 | 206 | type 'nmake -f makefile.dos'. |
2bda0e17 | 207 | |
e2a6f233 JS |
208 | Add FINAL=1 to your makefile invocation to build the release |
209 | versions of the library and samples. | |
210 | ||
211 | Use the 'clean' target to clean all objects, libraries and | |
212 | executables. | |
213 | ||
2bda0e17 KB |
214 | Borland C++ 4.5/5.0 compilation |
215 | ------------------------------- | |
216 | ||
ca5c8b2d JS |
217 | Compiling using the makefiles: |
218 | ||
62448488 JS |
219 | 1. Make sure your WXWIN variable is set, and uses the FAT (short |
220 | name) form if doing a 16-bit compile. | |
221 | 2. 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. | |
c0bcc480 | 224 | 3. Change directory to a sample or demo such as samples\minimal, and type |
62448488 | 225 | 'make -f makefile.b32'. |
4bf78aae JS |
226 | 4. 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. | |
f6bcfd97 BP |
230 | 5. 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. | |
62448488 | 237 | |
1a7f3062 | 238 | Note (1): the wxWindows library and (some) samples compile in 16-bit mode |
3b1de9c2 JS |
239 | using makefile.bcc, but at present the wxWindows resource system is switched |
240 | off in this mode. See issues.txt for details. | |
2bda0e17 | 241 | |
8fb3a512 JS |
242 | Note (2): unfortunately most samples won't link in 16-bit mode, |
243 | because the automatic data segment exceeds 64K. The minimal | |
244 | sample links and runs, however. | |
245 | ||
246 | Note (3): the wxWindows makefiles assume byte structure alignment. Please | |
1a7f3062 JS |
247 | make sure that your own project or makefile settings use the |
248 | same alignment, or you could experience mysterious crashes. To | |
249 | change the alignment, add a suitable option to the $(CFG) target code | |
250 | in src/msw/makefile.b32. | |
251 | ||
154f22b3 JS |
252 | Note (4): if you get undefined _SQL... symbols at link time, |
253 | either install odbc32.lib from the BC++ CD-ROM into your BC++ lib | |
254 | directory, or set wxUSE_ODBC to 0 in include\wx\msw\setup.h and | |
255 | recompile wxWindows. The same applies if compiling using the IDE. | |
256 | ||
790ad94f JS |
257 | Note (5): BC++ 4.5 (not 5.0) trips up over jdmerge.c in the JPEG folder; |
258 | you will therefore need to set wxUSE_LIBJPEG to 0 in setup.h and remove | |
b2cf617c JS |
259 | the jpeg target from src\msw\makefile.b32, and remove jpeg from |
260 | src\makeprog.b32. | |
790ad94f | 261 | |
9c824f29 JS |
262 | Note (6): If using C++Builder 4 and above (BC++ 5.4 and above), change LINK=tlink32 to |
263 | LINK=ilink32 in src\makeb32.env. You may also need to disable | |
264 | wxUSE_LIBJPEG because there is a conflict in the BC++ headers | |
265 | (actually this problem seems to have gone away with 5.5 and SP1). | |
c3b177ae | 266 | |
7fee680b JS |
267 | Note (7): If you wish debug messages to be sent to the console in |
268 | debug mode, edit src\makeb32.env and change /aa to /Tpe in | |
269 | LINK_FLAGS. | |
270 | ||
ca5c8b2d JS |
271 | Compiling using the IDE files: |
272 | ||
01dba85a | 273 | 1. Load src\bc32.ide (Release settings) |
ca5c8b2d JS |
274 | 2. Go to Options|Project... and specify the correct BC++ include and lib path for |
275 | your file structure. | |
276 | 3. Press F9 to compile the wxWindows library. | |
33b64e6f | 277 | 4. Load samples\bc32.ide. |
ca5c8b2d JS |
278 | 5. Go to Options|Project... and specify the correct BC++ include and lib path for |
279 | your file structure. | |
01dba85a JS |
280 | 6. Press F9 to compile the samples (build each node separately if |
281 | you prefer, by right clicking and choose Build Node). | |
282 | 7. 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. | |
ca5c8b2d | 285 | |
c0bcc480 JS |
286 | Note (1): the samples project file contains a selection of |
287 | samples, and not all samples. The remaining samples can be made | |
288 | with the makefiles. See also the demos hierarchy which doesn't | |
289 | have any BC++ project files yet. | |
290 | ||
fb1bd1bd | 291 | Note (2): to make the png, zlib, jpeg and tiff libraries (needed for |
01dba85a | 292 | some samples) you need to compile them with bc32.ide. |
33b64e6f | 293 | |
c0bcc480 JS |
294 | Note (3): the debug version of the wxWindows library is about 40 MB, and the |
295 | release version is around 5 MB. | |
33b64e6f | 296 | |
f6bcfd97 | 297 | See also the file docs/tech/tn0007.txt for further instructions and details |
ca5c8b2d JS |
298 | of how to create your own project files. |
299 | ||
f6bcfd97 BP |
300 | Borland C++ 5.5 compilation |
301 | --------------------------- | |
302 | ||
303 | Before compiling wxWindows with Borland C++ 5.5, there are a few | |
304 | issues concerning the compiler installation: | |
305 | ||
306 | 1. 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 | ||
310 | 2. 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/file_supplements.html | |
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 | ||
321 | 3. 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 | ||
336 | 4. 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 | ||
340 | Compiling wxWindows: | |
341 | ||
342 | Once the compiler and its service pack are properly installed, you build | |
343 | wxWindows using the provided makefile.b32 in the src/msw directory: | |
344 | ||
345 | a. 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 | ||
352 | b. 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 | ||
361 | IMPORTANT: | |
362 | The Service Pack 1 for Borland C++ 5.5 must be installed before wxWindows | |
363 | is compiled. If you compiled wxWindows before, it is advised that you | |
364 | re-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 | ||
374 | In all of your wxWindows applications, your source code should include | |
375 | the 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 | |
382 | more details) | |
383 | ||
4bf78aae JS |
384 | Borland C++Builder compilation |
385 | ------------------------------ | |
386 | ||
f6bcfd97 BP |
387 | 1. 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.) | |
3f1af920 | 391 | |
f6bcfd97 BP |
392 | 2. 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. | |
4bf78aae | 395 | |
ace03f87 | 396 | Watcom C++ 10.6/11 compilation |
7be1f0d9 JS |
397 | --------------------------- |
398 | ||
cba2db0c JS |
399 | 1. Make sure your WXWIN variable is set, and uses the DOS short |
400 | name form. | |
62448488 | 401 | 2. Change directory to wx\src\msw. Type 'wmake -f makefile.wat' to |
7be1f0d9 | 402 | make the wxWindows core library. |
62448488 | 403 | 3. Change directory to wx\samples\minimal and type 'wmake -f makefile.wat' |
ace03f87 JS |
404 | to make this sample. Repeat for other samples of interest. |
405 | ||
f6bcfd97 | 406 | Note (1): makewat.env uses the odbc32.lib supplied in wxWindows' lib\watcom |
ace03f87 | 407 | directory. See the notes in that directory. |
f6bcfd97 | 408 | Note (2): if variant.cpp is compiled with date/time class |
457e6c54 JS |
409 | options, the linker gives up. So the date/time option is switched |
410 | off for Watcom C++. Also, wxAutomationObject is not compiled with | |
411 | Watcom C++. | |
f6bcfd97 | 412 | Note (3): if Watcom can't read the precompiled header when |
457e6c54 JS |
413 | building a sample, try deleting src\msw\watcom.pch and |
414 | compiling the sample again. | |
7be1f0d9 | 415 | |
62448488 JS |
416 | Metrowerks CodeWarrior compilation |
417 | ---------------------------------- | |
418 | ||
f6bcfd97 | 419 | 1. Downloaded and unzip wxWindows-x.y.z-cw.zip. |
3b1de9c2 JS |
420 | 2. Load the make_cw.mcp project in wx\src, and compile. |
421 | 3. 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. | |
62448488 | 424 | |
8fb3a512 | 425 | Note (1): you need CodeWarrior Pro 4 plus the patches to 4.1 from the |
33b64e6f | 426 | Metrowerks Web site. |
0a240683 | 427 | |
8fb3a512 JS |
428 | Note (2): unfortunately these files are not yet up-to-date for the |
429 | current release. | |
430 | ||
3f1af920 JS |
431 | Symantec C++ compilation |
432 | ------------------------ | |
433 | ||
434 | 1. Make sure your WXWIN variable is set, and uses the FAT (short | |
435 | name) form. | |
436 | 2. Edit setup.h and set wxUSE_DRAG_AND_DROP to 0. | |
437 | 3. Change directory to wx\src\msw. Type 'make -f makefile.sc' to | |
438 | make the wxWindows core library. | |
439 | 4. Change directory to wx\samples\minimal and type 'make -f makefile.sc' | |
440 | to make this sample. | |
441 | ||
442 | Note: the minimal sample doesn't link properly ('Error: no | |
443 | start address'). | |
444 | 32-bit compilation only (partially) supported at present, using SC++ 6.1. | |
445 | Some functionality is missing using this compiler (see makefile). | |
446 | Add -D__WIN95__ if your SC++ has Windows 95 support, and ignore | |
447 | Step (2). 16-bit compilation is left as an excercise for the user! | |
448 | ||
ce3ed50d JS |
449 | Salford C++ compilation |
450 | ----------------------- | |
451 | ||
452 | 1. Make sure your WXWIN variable is set, and uses the FAT (short | |
453 | name) form. | |
454 | 2. Edit SALFORDDIR and RESOURCEDIR in src/makesl.env as per | |
455 | notes. | |
456 | 3. Change directory to wx\src\msw. Type 'mk32 -f makefile.sl all' to | |
457 | make the wxWindows core library. | |
458 | 4. Change directory to wx\samples\minimal and type 'mk32 -f makefile.sl' | |
459 | to make this sample. | |
460 | ||
461 | Unfortunately, Salford C++ seems to have problems with its code generation for | |
462 | operations on objects, as seen in wxFrame::OnMenuHighlight | |
463 | (minimal sample) or wxWindow::SetValidator (mdi sample). Also the | |
464 | the debugging version of the library is 90MB, with samples coming in | |
465 | at 40MB :-) However, wxWindows at least makes a good test suite for | |
466 | improving the compiler. | |
467 | ||
74afbadc | 468 | Cygwin/Mingw32 compilation |
8870c26e | 469 | ---------------------------------- |
2bda0e17 | 470 | |
74afbadc JS |
471 | wxWindows 2 supports Cygwin (formerly GnuWin32) betas and |
472 | releases, and Mingw32. | |
2bda0e17 | 473 | |
74afbadc JS |
474 | Thanks are due to Keith Garry Boyce (garp@opustel.com), Cygnus |
475 | and others for making it all possible. | |
2bda0e17 | 476 | |
f6bcfd97 BP |
477 | Both Cygwin and Mingw32 (the minimal distribution of Cygwin) can be used |
478 | with the same makefiles. | |
2bda0e17 KB |
479 | |
480 | Here are the steps required: | |
481 | ||
8870c26e | 482 | - Retrieve and install the latest beta of Cygwin, or Mingw32, as per the |
2bda0e17 KB |
483 | instructions with either of these packages. |
484 | ||
74afbadc | 485 | - If using Mingw32, you need some extra files to use the wxWindows |
ee21d154 JS |
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 | |
8870c26e JS |
489 | from elsewhere, you won't need this. |
490 | ||
b2cf617c | 491 | If using Mingw32 2.95 and below with wxWindows 2.1 or above, you |
f6bcfd97 BP |
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. | |
2bda0e17 KB |
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 | ||
8870c26e | 500 | - For Cygwin, make sure there's a \tmp directory on your |
ee21d154 JS |
501 | Windows drive or bison will crash (actually you don't need |
502 | bison for ordinary wxWindows compilation: a pre-generated .c file is | |
b2cf617c | 503 | supplied). |
2bda0e17 | 504 | |
4c0a2c5c | 505 | - Edit wx/src/makeg95.env and set the MINGW32 variable at the top of |
74afbadc JS |
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. | |
4fabb575 | 509 | |
dbda9e86 | 510 | - Set your WXWIN variable to where wxWindows is installed. |
25889d3c JS |
511 | *** IMPORTANT: For Cygwin/Mingw32, use forward slashes in the path, not |
512 | backslashes. | |
dbda9e86 | 513 | |
2bda0e17 KB |
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 | ||
cba2db0c JS |
521 | Ignore the warning about the default entry point. |
522 | ||
2bda0e17 KB |
523 | - Use the 'strip' command to reduce executable size. |
524 | ||
74afbadc | 525 | - With Cygwin, you can invoke gdb --nw myfile.exe to |
4fabb575 JS |
526 | debug an executable. If there are memory leaks, they will be |
527 | flagged when the program quits. | |
2bda0e17 KB |
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 | ||
532 | All targets have 'clean' targets to allow removal of object files | |
533 | and other intermediate compiler files. | |
534 | ||
7c5dc04f | 535 | Notes: |
2bda0e17 | 536 | |
bf4d9b2b JS |
537 | 1. See also the Cygwin/Mingw32 on the web site or CD-ROM for |
538 | further information about using wxWindows with these compilers. | |
7c5dc04f | 539 | |
bf4d9b2b JS |
540 | 2. libwx.a is 48 MB or more - but much less if compiled with no |
541 | debug info (-g0) and level 4 optimization (-O4). | |
7c5dc04f | 542 | |
bf4d9b2b | 543 | 3. There's a bug in Mingw32 headers for some early distributions. |
7c5dc04f | 544 | |
bf4d9b2b | 545 | in include/windows32/defines.h, where it says: |
7c5dc04f | 546 | |
bf4d9b2b | 547 | #define LPSTR_TEXTCALLBACKA (LPSTR)-1L) |
7c5dc04f | 548 | |
bf4d9b2b | 549 | it should say: |
7c5dc04f | 550 | |
bf4d9b2b | 551 | #define LPSTR_TEXTCALLBACKA ((LPSTR)-1L) |
7c5dc04f | 552 | |
bf4d9b2b | 553 | (a missing bracket). |
7c5dc04f | 554 | |
f6bcfd97 | 555 | 4. If there's a problem with the copy or remove commands in |
bf4d9b2b | 556 | src/msw/makefile.g95, you may need to change the COPY and |
f6bcfd97 | 557 | RM variables in makeg95.env. |
51babd09 | 558 | |
bf4d9b2b JS |
559 | 5. If there's a problem executing the windres program, try |
560 | commenting out RCPREPROCESSOR in makeg95.env. | |
51babd09 | 561 | |
fac26663 JS |
562 | 6. 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 | ||
2bda0e17 KB |
575 | References: |
576 | ||
74afbadc JS |
577 | - The Cygwin site is at |
578 | http://sourceware.cygnus.com | |
2bda0e17 | 579 | - Mingw32 is available at: |
74afbadc | 580 | ftp://www.mingw.org |
2bda0e17 | 581 | |
57c208c5 JS |
582 | TWIN32 and gcc on Linux |
583 | ----------------------- | |
584 | ||
585 | The wxWindows 2 for Windows port may be compiled using | |
586 | the TWIN32 emulator package from www.willows.com. However, | |
587 | TWIN32 is by no means finished so this should be taken as | |
588 | something to think about for the future, rather than | |
589 | a tool for writing products with. | |
590 | ||
591 | Use makefile.twn in much the same way as makefile.g95, as | |
592 | described above. Not all sample makefiles are supplied yet. | |
593 | ||
8870c26e JS |
594 | For some reason, I found I had to copy TWIN32's Windows resource |
595 | compiler (rc) to the current working directory for it to be found. | |
596 | ||
597 | General Notes | |
598 | ------------- | |
a0a302dc JS |
599 | |
600 | - Debugging: under Windows 95, debugging output isn't output in | |
9c6751aa JS |
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. | |
62448488 | 605 | |
e3065973 JS |
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. | |
f6bcfd97 BP |
609 | Please copy setup0.h to setup.h before compiling. Also, read |
610 | the BuildCVS.txt for other hints. | |
bf4d9b2b | 611 |