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