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