]>
Commit | Line | Data |
---|---|---|
8e1e6fac | 1 | |
2e1e7f9d VZ |
2 | !!! When sending bug reports tell us what version of wxWindows you are |
3 | using (including the beta) and what compiler on what system. One | |
fb1bd1bd | 4 | example: wxGTK 2.3.0, egcs 1.1.1, Redhat 6.2 !!! |
8e1e6fac | 5 | |
c98f0421 RR |
6 | * The most simple case |
7 | ----------------------- | |
8 | ||
2e1e7f9d | 9 | If you compile wxWindows on Linux for the first time and don't like to read |
91b8de8d | 10 | install instructions just do (in the base dir): |
c98f0421 | 11 | |
9b61f868 RR |
12 | > ./configure --with-gtk |
13 | > make | |
14 | > su <type root password> | |
15 | > make install | |
16 | > ldconfig | |
17 | > exit | |
034be888 | 18 | |
9b61f868 RR |
19 | Afterwards you can continue with |
20 | ||
21 | > make | |
22 | > su <type root password> | |
23 | > make install | |
24 | > ldconfig | |
25 | > exit | |
4dcaf11a | 26 | |
8e1e6fac RR |
27 | If you want to remove wxWindows on Unix you can do this: |
28 | ||
9b61f868 RR |
29 | > su <type root password> |
30 | > make uninstall | |
31 | > ldconfig | |
32 | > exit | |
cf7a7e13 | 33 | |
2b62ab35 RR |
34 | * The expert case |
35 | ----------------- | |
36 | ||
2e1e7f9d VZ |
37 | If you want to do some more serious cross-platform programming with wxWindows, |
38 | such as for GTK and Motif, you can now build two complete libraries and use | |
2edb0bde | 39 | them concurrently. For this end, you have to create a directory for each build |
91b8de8d | 40 | of wxWindows - you may also want to create different versions of wxWindows |
2e1e7f9d | 41 | and test them concurrently. Most typically, this would be a version configured |
2edb0bde VZ |
42 | with --enable-debug_flag and one without. Note, that only one build can |
43 | currently be installed, so you'd have to use local version of the library for | |
44 | that purpose. | |
45 | ||
2e1e7f9d | 46 | For building three versions (one GTK, one Motif and a debug version of the GTK |
51d55e1c | 47 | source) you'd do this: |
2b62ab35 RR |
48 | |
49 | md buildmotif | |
50 | cd buildmotif | |
51 | ../configure --with-motif | |
52 | make | |
53 | cd .. | |
54 | ||
55 | md buildgtk | |
56 | cd buildgtk | |
57 | ../configure --with-gtk | |
58 | make | |
59 | cd .. | |
60 | ||
61 | md buildgtkd | |
62 | cd buildgtkd | |
51d55e1c | 63 | ../configure --with-gtk --enable-debug_flag |
2b62ab35 RR |
64 | make |
65 | cd .. | |
66 | ||
2a29700e RR |
67 | * The most simple errors |
68 | ------------------------ | |
69 | ||
2e1e7f9d VZ |
70 | For any configure errors: please look at config.log file which was generated |
71 | during configure run, it usually contains some useful information. | |
72 | ||
73 | configure reports, that you don't have GTK 1.2 installed although you are | |
74 | very sure you have. Well, you have installed it, but you also have another | |
75 | version of the GTK installed, which you may need to remove including other | |
76 | versions of glib (and its headers). Or maybe you installed it in non default | |
77 | location and configure can't find it there, so please check that your PATH | |
78 | variable includes the path to the correct gtk-config. Also check that your | |
79 | LD_LIBRARY_PATH or equivalent variable contains the path to GTK+ libraries if | |
80 | they were installed in a non default location. | |
81 | ||
82 | You get errors from make: please use GNU make instead of the native make | |
83 | program. Currently wxWindows can be built only with GNU make, BSD make and | |
84 | Solaris make. Other versions might work or not (any which don't have VPATH | |
85 | support definitely won't). | |
86 | ||
87 | You get errors during compilation: The reason is that you probably have a | |
88 | broken compiler, which includes a lot of old gcc versions. In particular, if | |
2edb0bde | 89 | you use gcc 2.8 you have to disable optimisation as the compiler will give up |
2e1e7f9d VZ |
90 | with an internal compiler error. |
91 | ||
92 | You get immediate segfault when starting any sample or application: This is | |
93 | either due to having compiled the library with different flags or options than | |
94 | your program - typically you might have the __WXDEBUG__ option set for the | |
95 | library but not for your program - or due to using a broken compiler (and its | |
96 | optimisation) such as gcc 2.8. | |
97 | ||
98 | Linker complains about missing PROIO_yy_flex_alloc and similar symbols: you | |
99 | probably have an old version of flex, 2.5.4 is recommended. | |
3502e687 | 100 | |
2a29700e RR |
101 | * The most simple program |
102 | ------------------------- | |
103 | ||
91b8de8d | 104 | Now create your super-application myfoo.app and compile anywhere with |
cf7a7e13 | 105 | |
bbeb6c2b | 106 | gcc myfoo.cpp `wx-config --libs --cflags` -o myfoo |
c98f0421 RR |
107 | |
108 | * General | |
109 | ----------------------- | |
110 | ||
2e1e7f9d | 111 | The Unix variants of wxWindows use GNU configure. If you have problems with your |
91b8de8d | 112 | make use GNU make instead. |
c98f0421 | 113 | |
2e1e7f9d | 114 | If you have general problems with installation, read my homepage at |
c98f0421 RR |
115 | |
116 | http://wesley.informatik.uni-freiburg.de/~wxxt | |
2e1e7f9d VZ |
117 | |
118 | for newest information. If you still don't have any success, please send a bug | |
119 | report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF | |
120 | YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT DISTRIBUTION | |
91b8de8d | 121 | YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried... |
c98f0421 RR |
122 | |
123 | * GUI libraries | |
124 | ----------------------- | |
125 | ||
2e1e7f9d | 126 | wxWindows/GTK requires the GTK+ library to be installed on your system. It has |
2edb0bde | 127 | to be a stable version, preferably version 1.2.10 (at least 1.2.3 is required, |
2e1e7f9d | 128 | 1.2.7 is strongly recommended). |
91b8de8d RR |
129 | |
130 | You can get the newest version of the GTK+ from the GTK homepage at: | |
c98f0421 | 131 | |
c98f0421 | 132 | http://www.gtk.org |
2e1e7f9d VZ |
133 | |
134 | We also mirror GTK+ at my ftp site. You'll find information about downloading | |
91b8de8d | 135 | at my homepage. |
2e1e7f9d | 136 | |
c98f0421 RR |
137 | * Additional libraries |
138 | ----------------------- | |
139 | ||
2e1e7f9d VZ |
140 | wxWindows/Gtk requires a thread library and X libraries known to work with threads. |
141 | This is the case on all commercial Unix-Variants and all Linux-Versions that are | |
142 | based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing | |
91b8de8d | 143 | this, these Linux distributions have correct glibc 2 support: |
58614078 RR |
144 | |
145 | - RedHat 5.1 | |
146 | - Debian 2.0 | |
147 | - Stampede | |
4f22cf8d | 148 | - DLD 6.0 |
cffee23b | 149 | - SuSE 6.0 |
58614078 | 150 | |
2e1e7f9d VZ |
151 | You can disable thread support by running |
152 | ||
153 | ./configure --disable-threads | |
58614078 | 154 | make |
034be888 | 155 | su <type root password> |
8710cf5c | 156 | make install |
034be888 RR |
157 | ldconfig |
158 | exit | |
2e1e7f9d VZ |
159 | |
160 | NB: DO NOT COMPILE WXGTK WITH GCC 2.7 AND THREADS, SINCE ALL PROGRAMS WILL CRASH UPON | |
91b8de8d | 161 | START-UP! Just always use egcs and be happy. |
3502e687 | 162 | |
91b8de8d RR |
163 | * Building wxGTK on OS/2 |
164 | -------------------------- | |
c98f0421 | 165 | |
91b8de8d RR |
166 | Please send comments and question about the OS/2 installation |
167 | to Andrea Venturoli <a.ventu@flashnet.it> and patches to | |
510fc784 | 168 | the wxWindows mailing list. |
c98f0421 | 169 | |
2e1e7f9d VZ |
170 | You'll need OS/2 Warp (4.00FP#6), X-Free86/2 (3.3.3 or newer), |
171 | GTK+ (1.2.5 or newer), emx (0.9d fix 1), flex (2.5.4), yacc (1.8), | |
172 | korn shell (5.2.13), Autoconf (2.13), GNU file utilities (3.6), | |
173 | GNU text utilities (1.3), GNU shell utilites (1.12), m4 (1.4), | |
91b8de8d | 174 | sed (2.05), grep (2.0), Awk (3.0.3), GNU Make (3.76.1). |
c98f0421 | 175 | |
91b8de8d RR |
176 | Open an OS/2 prompt and switch to the directory above. |
177 | First set some global environment variables we need: | |
178 | ||
179 | SET CXXFLAGS=-Zmtd -D__ST_MT_ERRNO__ | |
9f2d09aa | 180 | SET CFLAGS=-Zmtd -D__ST_MT_ERRNO__ |
2e1e7f9d | 181 | SET OSTYPE=OS2X |
91b8de8d RR |
182 | SET COMSPEC=sh |
183 | ||
184 | Notice you can choose whatever you want, if you don't like OS2X. | |
185 | ||
ea0dbf30 SN |
186 | Now, run autoconf in the main directory and in the samples, demos |
187 | and utils subdirectory. This will generate the OS/2 specific | |
188 | versions of the configure scripts. Now run | |
189 | configure --with-gtk | |
190 | as described above. | |
191 | ||
192 | If you have pthreads library installed, but have a gtk version | |
193 | which does not yet support threading, you need to explicitly | |
2edb0bde | 194 | disable threading by using the option --disable-threads. |
ea0dbf30 SN |
195 | |
196 | Note that configure assumes your flex will generate files named | |
197 | "lexyy.c", not "lex.yy.c". If you have a version which does | |
198 | generate "lex.yy.c", you need to manually change the generated | |
199 | makefile. | |
9f2d09aa | 200 | |
91b8de8d RR |
201 | * Building wxGTK on SGI |
202 | -------------------------- | |
c98f0421 RR |
203 | |
204 | Using the SGI native compilers, it is recommended that you | |
2e1e7f9d | 205 | also set CFLAGS and CXXFLAGS before running configure. These |
c98f0421 RR |
206 | should be set to : |
207 | ||
2e1e7f9d | 208 | CFLAGS="-mips3 -n32" |
c98f0421 RR |
209 | CXXFLAGS="-mips3 -n32" |
210 | ||
2e1e7f9d VZ |
211 | This is essential if you want to use the resultant binaries |
212 | on any other machine than the one it was compiled on. If you | |
213 | have a 64bit machine (Octane) you should also do this to ensure | |
214 | you don't accidently build the libraries as 64bit (which is | |
c98f0421 RR |
215 | untested). |
216 | ||
217 | The SGI native compiler support has only been tested on Irix 6.5. | |
218 | ||
91b8de8d RR |
219 | * Create your configuration |
220 | ----------------------------- | |
221 | ||
222 | Usage: | |
2e1e7f9d | 223 | ./configure options |
91b8de8d RR |
224 | |
225 | If you want to use system's C and C++ compiler, | |
226 | set environment variables CC and CCC as | |
227 | ||
2e1e7f9d VZ |
228 | % setenv CC cc |
229 | % setenv CCC CC | |
230 | % ./configure options | |
91b8de8d | 231 | |
c98f0421 RR |
232 | to see all the options please use: |
233 | ||
2e1e7f9d | 234 | ./configure --help |
c98f0421 | 235 | |
2e1e7f9d VZ |
236 | It is recommended to build wxWindows in another directory (maybe a |
237 | subdirectory of your wxWindows installation) as this allows you to | |
238 | have multiple configurations (for example, debug and release or GTK | |
239 | and Motif) simultaneously. | |
c98f0421 RR |
240 | |
241 | ||
242 | * General options | |
243 | ------------------- | |
244 | ||
77c85c2b RR |
245 | Given below are the commands to change the default behaviour, |
246 | i.e. if it says "--disable-threads" it means that threads | |
247 | are enabled by default. | |
248 | ||
cf7a7e13 RR |
249 | Normally, you won't have to choose a toolkit, because when |
250 | you download wxGTK, it will default to --with-gtk etc. But | |
2e1e7f9d | 251 | if you use all of our CVS repository you have to choose a |
cf7a7e13 | 252 | toolkit. You must do this by running configure with either of: |
c98f0421 | 253 | |
4b6b4dfc | 254 | --with-gtk Use the GIMP ToolKit (GTK). Default. |
2e1e7f9d VZ |
255 | |
256 | --with-motif Use either Motif or Lesstif | |
257 | Configure will look for both. | |
c98f0421 RR |
258 | |
259 | The following options handle the kind of library you want to build. | |
260 | ||
2e1e7f9d | 261 | --disable-threads Compile without thread support. |
c98f0421 | 262 | |
2e1e7f9d | 263 | --disable-shared Do not create shared libraries, but |
4b6b4dfc | 264 | build static libraries instead. |
bbeb6c2b | 265 | |
2e1e7f9d VZ |
266 | --disable-optimise Do not optimise the code. Can |
267 | sometimes be useful for debugging | |
4b6b4dfc RR |
268 | and is required on some architectures |
269 | such as Sun with gcc 2.8.X which | |
270 | would otherwise produce segvs. | |
c98f0421 | 271 | |
2e1e7f9d VZ |
272 | --enable-profile Add profiling info to the object |
273 | files. Currently broken, I think. | |
274 | ||
275 | --enable-no_rtti Enable compilation without creation of | |
276 | C++ RTTI information in object files. | |
277 | This will speed-up compilation and reduce | |
4b6b4dfc | 278 | binary size. |
2e1e7f9d VZ |
279 | |
280 | --enable-no_exceptions Enable compilation without creation of | |
281 | C++ exception information in object files. | |
282 | This will speed-up compilation and reduce | |
4b6b4dfc RR |
283 | binary size. Also fewer crashes during the |
284 | actual compilation... | |
2e1e7f9d VZ |
285 | |
286 | --enable-no_deps Enable compilation without creation of | |
287 | dependency information. | |
288 | ||
2edb0bde VZ |
289 | --enable-permissive Enable compilation without checking for strict |
290 | ANSI conformance. Useful to prevent the build | |
291 | dying with errors as soon as you compile with | |
2e1e7f9d VZ |
292 | Solaris' ANSI-defying headers. |
293 | ||
294 | --enable-mem_tracing Add built-in memory tracing. | |
295 | ||
296 | --enable-dmalloc Use the dmalloc memory debugger. | |
297 | Read more at www.letters.com/dmalloc/ | |
298 | ||
299 | --enable-debug_info Add debug info to object files and | |
300 | executables for use with debuggers | |
301 | such as gdb (or its many frontends). | |
302 | ||
303 | --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when | |
304 | compiling. This enable wxWindows' very | |
4b6b4dfc RR |
305 | useful internal debugging tricks (such |
306 | as automatically reporting illegal calls) | |
307 | to work. Note that program and library | |
2e1e7f9d | 308 | must be compiled with the same debug |
4b6b4dfc | 309 | options. |
c98f0421 RR |
310 | |
311 | * Feature Options | |
312 | ------------------- | |
313 | ||
3cdda6cd RR |
314 | When producing an executable that is linked statically with wxGTK |
315 | you'll be surprised at its immense size. This can sometimes be | |
2e1e7f9d | 316 | drastically reduced by removing features from wxWindows that |
3cdda6cd RR |
317 | are not used in your program. The most relevant such features |
318 | are | |
319 | ||
2e1e7f9d | 320 | --with-odbc Enables ODBC code. This is disabled |
cc977e5f | 321 | by default because iODBC is under the |
2e1e7f9d VZ |
322 | L-GPL license which is less liberal than |
323 | wxWindows license. | |
324 | ||
325 | --without-libpng Disables PNG image format code. | |
326 | ||
327 | --without-libjpeg Disables JPEG image format code. | |
328 | ||
329 | --without-libtiff Disables TIFF image format code. | |
330 | ||
331 | --disable-pnm Disables PNM image format code. | |
332 | ||
333 | --disable-gif Disables GIF image format code. | |
334 | ||
335 | --disable-pcx Disables PCX image format code. | |
336 | ||
337 | --disable-iff Disables IFF image format code. | |
338 | ||
339 | --disable-resources Disables the use of *.wxr type resources. | |
340 | ||
341 | --disable-threads Disables threads. Will also disable sockets. | |
342 | ||
343 | --disable-sockets Disables sockets. | |
344 | ||
345 | --disable-dnd Disables Drag'n'Drop. | |
346 | ||
347 | --disable-clipboard Disables Clipboard. | |
348 | ||
2edb0bde | 349 | --disable-serial Disables object instance serialisation. |
2e1e7f9d VZ |
350 | |
351 | --disable-streams Disables the wxStream classes. | |
352 | ||
353 | --disable-file Disables the wxFile class. | |
354 | ||
355 | --disable-textfile Disables the wxTextFile class. | |
356 | ||
357 | --disable-intl Disables the internationalisation. | |
358 | ||
359 | --disable-validators Disables validators. | |
360 | ||
361 | --disable-accel Disables accelerators support. | |
362 | ||
3cdda6cd RR |
363 | Apart from disabling certain features you can very often "strip" |
364 | the program of its debugging information resulting in a significant | |
365 | reduction in size. | |
c98f0421 RR |
366 | |
367 | * Compiling | |
368 | ------------- | |
369 | ||
370 | The following must be done in the base directory (e.g. ~/wxGTK | |
cf7a7e13 | 371 | or ~/wxWin or whatever) |
c98f0421 | 372 | |
2e1e7f9d | 373 | Now the makefiles are created (by configure) and you can compile |
8710cf5c | 374 | the library by typing: |
c98f0421 | 375 | |
2e1e7f9d | 376 | make |
c98f0421 | 377 | |
8710cf5c | 378 | make yourself some coffee, as it will take some time. On an old |
2e1e7f9d | 379 | 386SX possibly two weeks. During compilation, you'll get a few |
3cdda6cd | 380 | warning messages depending in your compiler. |
c98f0421 | 381 | |
51d55e1c | 382 | If you want to be more selective, you can change into a specific |
2edb0bde | 383 | directory and type "make" there. |
c98f0421 | 384 | |
2edb0bde | 385 | Then you may install the library and its header files under |
cf7a7e13 RR |
386 | /usr/local/include/wx and /usr/local/lib respectively. You |
387 | have to log in as root (i.e. run "su" and enter the root | |
388 | password) and type | |
389 | ||
2e1e7f9d | 390 | make install |
c98f0421 | 391 | |
8e1e6fac | 392 | You can remove any traces of wxWindows by typing |
c98f0421 | 393 | |
8e1e6fac | 394 | make uninstall |
2e1e7f9d | 395 | |
3cdda6cd | 396 | If you want to save disk space by removing unnecessary |
c98f0421 RR |
397 | object-files: |
398 | ||
2e1e7f9d | 399 | make clean |
c98f0421 | 400 | |
3cdda6cd | 401 | in the various directories will do the work for you. |
c98f0421 RR |
402 | |
403 | * Creating a new Project | |
404 | -------------------------- | |
405 | ||
f3cb6592 RR |
406 | 1) The first way uses the installed libraries and header files |
407 | automatically using wx-config | |
408 | ||
cc977e5f | 409 | gcc myfoo.cpp `wx-config --cflags --libs` -o myfoo |
f3cb6592 RR |
410 | |
411 | Using this way, a make file for the minimal sample would look | |
412 | like this | |
413 | ||
cc977e5f | 414 | CC = gcc |
f3cb6592 RR |
415 | |
416 | minimal: minimal.o | |
2e1e7f9d | 417 | $(CC) -o minimal minimal.o `wx-config --libs` |
f3cb6592 RR |
418 | |
419 | minimal.o: minimal.cpp mondrian.xpm | |
2e1e7f9d | 420 | $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o |
f3cb6592 | 421 | |
2e1e7f9d | 422 | clean: |
f3cb6592 RR |
423 | rm -f *.o minimal |
424 | ||
425 | This is certain to become the standard way unless we decide | |
2edb0bde | 426 | to stick to tmake. |
f3cb6592 | 427 | |
2e1e7f9d | 428 | 2) The other way creates a project within the source code |
8e1e6fac | 429 | directories of wxWindows. For this endeavour, you'll need |
79144b8a RR |
430 | GNU autoconf version 2.14 and add an entry to your Makefile.in |
431 | to the bottom of the configure.in script and run autoconf | |
432 | and configure before you can type make. | |
cf7a7e13 | 433 | |
91b8de8d | 434 | ---------------------- |
c98f0421 RR |
435 | |
436 | In the hope that it will be useful, | |
437 | ||
510fc784 RR |
438 | Robert Roebling |
439 |