1 wxWidgets 2.5 for GTK+ installation
2 -----------------------------------
6 If you experience problems installing, please re-read these
7 instructions and other related files (todo.txt, bugs.txt and
8 osname.txt for your platform if it exists) carefully before
9 mailing wxwin-users or the author. Preferably, try to fix the
10 problem first and then send a patch to the author.
12 When sending bug reports tell us what version of wxWidgets you are
13 using (including the beta) and what compiler on what system. One
14 example: wxGTK 2.6.0, gcc 2.95.4, Redhat 6.2
19 If you compile wxWidgets on Linux for the first time and don't like to read
20 install instructions just do (in the base dir):
24 > ../configure --with-gtk
26 > su <type root password>
31 Afterwards you can continue with:
34 > su <type root password>
39 (If you don't do the 'make install' part, you can still
40 use the libraries from the buildgtk directory, but they
41 will not be available to other users.)
43 If you want to remove wxWidgets on Unix you can do this:
45 > su <type root password>
50 Note that by default, GTK+ 2 is used. GTK+ 1 can be specified
56 wxGTK has support for the new version 2.0.X of GTK+ since version 2.4.0.
57 This means that wxGTK apps can now make use Unicode as the underlying encoding
58 for all text operations. This is a very fundamental change and will need time
59 to stabilize, so be careful. After installing a recent version of GTK+
64 > ../configure --with-gtk --enable-gtk2 --enable-unicode
66 > su <type root password>
71 If you are adventurous, you can install the FcConfig 2.0 package
72 and the Pango library from CVS (or a very recent snapshot from
73 the upcoming 1.2 series) and set do "export GDK_USE_XFT=1" so
74 that the display as well as the printing code will use render
75 using the same FreeType code even for Far Eastern encodings.
82 If you want to do some more serious cross-platform programming with wxWidgets,
83 such as for GTK+ and Motif, you can now build two complete libraries and use
84 them concurrently. To do this, create a separate directory for each build
85 of wxWidgets - you may also want to create different versions of wxWidgets
86 and test them concurrently. Most typically, this would be a version configured
87 with --enable-debug and one without. Note, that only one build can
88 currently be installed with 'make install', so you'd have to use local version of
89 the library for that purpose.
91 For building three versions (one GTK+, one Motif and a debug version of the GTK
92 source) you'd do this:
96 ../configure --with-motif
102 ../configure --with-gtk
108 ../configure --with-gtk --enable-debug
112 * The simplest errors
113 ---------------------
115 For any configure errors: please look at config.log file which was generated
116 during configure run, it usually contains some useful information.
118 configure reports, that you don't have GTK+ 1.2 installed although you are
119 very sure you have. Well, you have installed it, but you also have another
120 version of the GTK+ installed, which you may need to remove including other
121 versions of glib (and its headers). Or maybe you installed it in non default
122 location and configure can't find it there, so please check that your PATH
123 variable includes the path to the correct gtk-config. Also check that your
124 LD_LIBRARY_PATH or equivalent variable contains the path to GTK+ libraries if
125 they were installed in a non default location.
127 You get errors from make: please use GNU make instead of the native make
128 program. Currently wxWidgets can be built only with GNU make, BSD make and
129 Solaris make. Other versions might work or not (any which don't have VPATH
130 support definitely won't).
132 You get errors during compilation: The reason is that you probably have a
133 broken compiler. GCC 2.8 and earlier versions and egcs are likely to cause
134 problems due to incomplete support for C++ and optimisation bugs. Best to use
137 You get immediate segfault when starting any sample or application: This is
138 either due to having compiled the library with different flags or options than
139 your program - typically you might have the __WXDEBUG__ option set for the
140 library but not for your program - or due to using a compiler with optimisation
143 Linker complains about missing PROIO_yy_flex_alloc and similar symbols: you
144 probably have an old version of flex, 2.5.4 is recommended.
146 * The simplest program
147 ----------------------
149 Now create your super-application myfoo.cpp and compile anywhere with
151 g++ myfoo.cpp `wx-config --libs --cxxflags` -o myfoo
156 The Unix variants of wxWidgets use GNU configure. If you have problems with
157 your make use GNU make instead.
159 If you have general problems with installation, read my homepage at
161 http://wesley.informatik.uni-freiburg.de/~wxxt/
163 for newest information. If you still don't have any success, please send a bug
164 report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
165 YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT
166 DISTRIBUTION YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect,
172 wxWidgets/GTK+ requires the GTK+ library to be installed on your system. It has
173 to be a stable version, preferably version 1.2.10 (at least 1.2.3 is required,
174 1.2.7 is strongly recommended).
176 You can get the newest version of the GTK+ from the GTK+ homepage at:
180 We also mirror GTK+ at my ftp site. You'll find information about downloading
183 * Additional libraries
184 ----------------------
186 wxWidgets/Gtk requires a thread library and X libraries known to work with
187 threads. This is the case on all commercial Unix-Variants and all
188 Linux-Versions that are based on glibc 2 except RedHat 5.0 which is broken in
189 many aspects. As of writing this, virtually all Linux distributions have
190 correct glibc 2 support.
192 You can disable thread support by running
194 ./configure --disable-threads
196 su <type root password>
201 * Building wxGTK on OS/2
202 ------------------------
204 Please send comments and question about the OS/2 installation
205 to Stefan Neis <Stefan.Neis@t-online.de> and patches to
206 the wxWidgets mailing list.
208 In the following list, the version numbers indicate the configuration that
209 was actually used by myself, newer version should cause no problems and
210 even older ones are expected to work most of the time.
212 You'll need OS/2 Warp (4.51) or eCS(1.0), X-Free86/2 (3.3.6 or newer),
213 GTK+ (1.2.5 or newer), emx (0.9d fix 4), flex (2.5.4), yacc (1.8) or
214 bison (1.25), a Unix like shell (pdksh-5.2.14 or ash), Autoconf (2.57),
215 GNU file utilities (3.13), GNU text utilities (1.19),
216 GNU shell utilites (1.12), m4 (1.4), sed (2.05), grep (2.0), Awk (3.0.3),
219 Preferably, you should have Posix/2 installed and C(PLUS)_INCLUDE_PATH and
220 LIBRARY_PATH set up accordingly, however, wxGTK will even work without it.
221 Presence of Posix/2 will be auto-detected.
223 Open an OS/2 prompt and switch to the directory above.
224 Set MAKESHELL (and depending on your installation also INSTALL, for me
225 it tends to try to use the system's tcpip\pcomos\install.exe which causes
226 problems...) to a Unix like shell, e.g.
229 Be warned that depending on the precise version of your make, the
230 variable that needs to be set might be MAKE_SHELL instead of MAKESHELL.
231 If you have a really deficient version of GNU make, it might even be
232 necessary to set SHELL or even COMSPEC to a unix like shell as well.
234 Notice that the delivered configure scripts are fully OS/2 aware, so you
236 ash -c "configure --with-gtk"
237 and make and possibly make install as described above.
239 * Building wxGTK on SGI
240 -----------------------
242 Using the SGI native compilers, it is recommended that you
243 also set CFLAGS and CXXFLAGS before running configure. These
247 CXXFLAGS="-mips3 -n32"
249 This is essential if you want to use the resultant binaries
250 on any other machine than the one it was compiled on. If you
251 have a 64bit machine (Octane) you should also do this to ensure
252 you don't accidently build the libraries as 64bit (which is
255 The SGI native compiler support has only been tested on Irix 6.5.
257 * Create your configuration
258 ---------------------------
263 If you want to use system's C and C++ compiler,
264 set environment variables CC and CCC as
268 % ./configure [options]
270 to see all the options please use:
274 It is recommended to build wxWidgets in another directory (maybe a
275 subdirectory of your wxWidgets installation) as this allows you to
276 have multiple configurations (for example, debug and release or GTK
277 and Motif) simultaneously.
283 Given below are the commands to change the default behaviour,
284 i.e. if it says "--disable-threads" it means that threads
285 are enabled by default.
287 Normally, you won't have to choose a toolkit, because when
288 you download wxGTK, it will default to --with-gtk etc. But
289 if you use all of our CVS repository you have to choose a
290 toolkit. You must do this by running configure with either of:
292 --with-gtk Use the GIMP ToolKit (GTK+). Default.
294 --with-motif Use either Motif or Lesstif
295 Configure will look for both.
297 The following options handle the kind of library you want to build.
299 --disable-threads Compile without thread support.
301 --disable-shared Do not create shared libraries, but
302 build static libraries instead.
304 --enable-monolithic Build wxWidgets as single library instead
305 of as several smaller libraries (which is
306 the default since wxWidgets 2.5.0).
308 --disable-optimise Do not optimise the code. Can
309 sometimes be useful for debugging
310 and is required on some architectures
311 such as Sun with gcc 2.8.X which
312 would otherwise produce segvs.
314 --enable-unicode Enable Unicode support.
316 --enable-gtk2 Compiling using GTK+ 2 (the default).
318 --enable-profile Add profiling info to the object
319 files. Currently broken, I think.
321 --enable-no_rtti Enable compilation without creation of
322 C++ RTTI information in object files.
323 This will speed-up compilation and reduce
326 --enable-no_exceptions Enable compilation without creation of
327 C++ exception information in object files.
328 This will speed-up compilation and reduce
329 binary size. Also fewer crashes during the
330 actual compilation...
332 --enable-no_deps Enable compilation without creation of
333 dependency information.
335 --enable-permissive Enable compilation without checking for strict
336 ANSI conformance. Useful to prevent the build
337 dying with errors as soon as you compile with
338 Solaris' ANSI-defying headers.
340 --enable-mem_tracing Add built-in memory tracing.
342 --enable-dmalloc Use the dmalloc memory debugger.
343 Read more at www.letters.com/dmalloc/
345 --enable-debug_info Add debug info to object files and
346 executables for use with debuggers
347 such as gdb (or its many frontends).
349 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
350 compiling. This enable wxWidgets' very
351 useful internal debugging tricks (such
352 as automatically reporting illegal calls)
353 to work. Note that program and library
354 must be compiled with the same debug
357 --enable-debug Same as --enable-debug_info and
358 --enable-debug_flag together. Unless you have
359 some very specific needs, you should use this
360 option instead of --enable-debug_info/flag ones
366 When producing an executable that is linked statically with wxGTK
367 you'll be surprised at its immense size. This can sometimes be
368 drastically reduced by removing features from wxWidgets that
369 are not used in your program. The most relevant such features
372 --with-odbc Enables ODBC code. This is disabled
373 by default because iODBC is under the
374 L-GPL license which is less liberal than
377 --without-libpng Disables PNG image format code.
379 --without-libjpeg Disables JPEG image format code.
381 --without-libtiff Disables TIFF image format code.
383 --without-expat Disable XML classes based on Expat parser.
385 --disable-pnm Disables PNM image format code.
387 --disable-gif Disables GIF image format code.
389 --disable-pcx Disables PCX image format code.
391 --disable-iff Disables IFF image format code.
393 --disable-resources Disables the use of *.wxr type resources.
395 --disable-threads Disables threads. Will also disable sockets.
397 --disable-sockets Disables sockets.
399 --disable-dnd Disables Drag'n'Drop.
401 --disable-clipboard Disables Clipboard.
403 --disable-serial Disables object instance serialisation.
405 --disable-streams Disables the wxStream classes.
407 --disable-file Disables the wxFile class.
409 --disable-textfile Disables the wxTextFile class.
411 --disable-intl Disables the internationalisation.
413 --disable-validators Disables validators.
415 --disable-accel Disables accelerators support.
417 Apart from disabling certain features you can very often "strip"
418 the program of its debugging information resulting in a significant
421 Please see the output of "./configure --help" for comprehensive list
422 of all configurable options.
428 The following must be done in the base directory (e.g. ~/wxGTK
429 or ~/wxWin or whatever)
431 Now the makefiles are created (by configure) and you can compile
432 the library by typing:
436 make yourself some coffee, as it will take some time. On an old
437 386SX possibly two weeks. During compilation, you'll get a few
438 warning messages depending in your compiler.
440 If you want to be more selective, you can change into a specific
441 directory and type "make" there.
443 Then you may install the library and its header files under
444 /usr/local/include/wx and /usr/local/lib respectively. You
445 have to log in as root (i.e. run "su" and enter the root
450 You can remove any traces of wxWidgets by typing
454 If you want to save disk space by removing unnecessary
459 in the various directories will do the work for you.
461 * Creating a new Project
462 --------------------------
464 1) The first way uses the installed libraries and header files
465 automatically using wx-config
467 g++ myfoo.cpp `wx-config --cxxflags --libs` -o myfoo
469 Using this way, a make file for the minimal sample would look
475 $(CC) -o minimal minimal.o `wx-config --libs`
477 minimal.o: minimal.cpp mondrian.xpm
478 $(CC) `wx-config --cxxflags` -c minimal.cpp -o minimal.o
483 This is certain to become the standard way unless we decide
486 If your application uses only some of wxWidgets libraries, you can
487 specify required libraries when running wx-config. For example,
488 `wx-config --libs=html,core` will only output link command to link
489 with libraries required by core GUI classes and wxHTML classes. See
490 the manual for more information on the libraries.
492 2) The other way creates a project within the source code
493 directories of wxWidgets. For this endeavour, you'll need
494 GNU autoconf version 2.14 and add an entry to your Makefile.in
495 to the bottom of the configure.in script and run autoconf
496 and configure before you can type make.
498 ----------------------
500 In the hope that it will be useful,