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 !!!
7 -----------------------
9 If you compile wxWindows on Linux for the first time and don't like to read
10 install instructions just do (in the base dir):
12 > ./configure --with-gtk
14 > su <type root password>
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:
23 > ./configure --with-gtk --disable-static --enable-shared
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
28 archive_cmds="\$LD -shared ....
29 archive_expsym_cmds="\$LD -shared ....
31 which should be something like
33 archive_cmds="\$CC -shared ....
34 archive_expsym_cmds="\$CC -shared ....
36 Afterwards you can continue with
39 > su <type root password>
44 If you want to remove wxWindows on Unix you can do this:
46 > su <type root password>
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.
61 For building three versions (one GTK, one Motif and a debug version of the GTK
62 source) you'd do this:
66 ../configure --with-motif
72 ../configure --with-gtk
78 ../configure --with-gtk --enable-debug_flag
82 * The most simple errors
83 ------------------------
85 configure reports, that you don't have GTK 1.X installed although you are
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
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.
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
98 If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
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.
105 * The most simple program
106 -------------------------
108 Now create your super-application myfoo.app and compile anywhere with
110 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
113 -----------------------
115 The Unix variants of wxWindows use GNU configure. If you have problems with your
116 make use GNU make instead.
118 If you have general problems with installation, read my homepage at
120 http://wesley.informatik.uni-freiburg.de/~wxxt
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...
128 -----------------------
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
132 with wxWindows, albeit without Drag'n'Drop. wxWindows does work with the 1.1.X
133 versions of the GTK+ library.
135 You can get the newest version of the GTK+ from the GTK homepage at:
139 We also mirror GTK+ 1.0.6 at my ftp site. You'll find information about downloading
142 * Additional libraries
143 -----------------------
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:
156 You can disable thread support by running
158 ./configure "--disable-threads"
160 su <type root password>
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.
168 * Building wxGTK on OS/2
169 --------------------------
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).
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).
181 Open an OS/2 prompt and switch to the directory above.
182 First set some global environment variables we need:
184 SET CXXFLAGS=-Zmtd -D__ST_MT_ERRNO__
188 Notice you can choose whatever you want, if you don't like OS2X.
190 * Building wxGTK on SGI
191 --------------------------
193 Using the SGI native compilers, it is recommended that you
194 also set CFLAGS and CXXFLAGS before running configure. These
198 CXXFLAGS="-mips3 -n32"
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
206 The SGI native compiler support has only been tested on Irix 6.5.
208 * Create your configuration
209 -----------------------------
214 If you want to use system's C and C++ compiler,
215 set environment variables CC and CCC as
219 % ./configure options
221 to see all the options please use:
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
235 Configure will complain if the system variable OSTYPE has
236 not been defined. And Make in some circumstances as well...
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.
246 Many of the confiugre options have been thoroughly tested
247 in wxWindows snapshot 6, but not yet all (ODBC not).
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:
254 --without-gtk Don't use the GIMP ToolKit (GTK)
256 --with-motif Use either Motif or Lesstif
257 Configure will look for both.
259 The following options handle the kind of library you want to build.
261 --disable-threads Compile without thread support. Threads
262 support is also required for the
265 --disable-shared Do not create shared libraries.
267 --disable-optimise Do not optimise the code. Can
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.
273 --enable-profile Add profiling info to the object
274 files. Currently broken, I think.
276 --enable-no_rtti Enable compilation without creation of
277 C++ RTTI information in object files.
278 This will speed-up compilation and reduce
281 --enable-no_exceptions Enable compilation without creation of
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...
287 --enable-mem_tracing Add built-in memory tracing.
289 --enable-dmalloc Use the dmalloc memory debugger.
290 Read more at www.letters.com/dmalloc/
292 --enable-debug_info Add debug info to object files and
293 executables for use with debuggers
294 such as gdb (or its many frontends).
296 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
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
307 Many of the confiugre options have been thoroughly tested
308 in wxWindows snapshot 6, but not yet all (ODBC not).
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
316 --without-libpng Disables PNG image format code.
318 --without-libjpeg Disables JPEG image format code.
320 { --without-odbc Disables ODBC code. Not yet. }
322 --disable-resources Disables the use of *.wxr type
325 --disable-threads Disables threads. Will also
328 --disable-sockets Disables sockets.
330 --disable-dnd Disables Drag'n'Drop.
332 --disable-clipboard Disables Clipboard.
334 --disable-serial Disables object instance serialiasation.
336 --disable-streams Disables the wxStream classes.
338 --disable-file Disables the wxFile class.
340 --disable-textfile Disables the wxTextFile class.
342 --disable-intl Disables the internationalisation.
344 --disable-validators Disables validators.
346 --disable-accel Disables accel.
348 Apart from disabling certain features you can very often "strip"
349 the program of its debugging information resulting in a significant
355 The following must be done in the base directory (e.g. ~/wxGTK
356 or ~/wxWin or whatever)
358 Now the makefiles are created (by configure) and you can compile
359 the library by typing:
363 make yourself some coffee, as it will take some time. On an old
364 386SX possibly two weeks. During compilation, you'll get a few
365 warning messages depending in your compiler.
367 If you want to be more selective, you can change into a specific
368 directiry and type "make" there.
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
377 You can remove any traces of wxWindows by typing
381 If you want to save disk space by removing unnecessary
386 in the various directories will do the work for you.
388 * Creating a new Project
389 --------------------------
391 1) The first way uses the installed libraries and header files
392 automatically using wx-config
394 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
396 Using this way, a make file for the minimal sample would look
402 $(CC) -o minimal minimal.o `wx-config --libs`
404 minimal.o: minimal.cpp mondrian.xpm
405 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
410 This is certain to become the standard way unless we decide
413 2) The other way creates a project within the source code
414 directories of wxWindows. For this endeavour, you'll need
415 the usual number of GNU tools, at least
417 GNU automake version 1.4
418 GNU autoheader version 2.14
419 GNU autoconf version 2.14
420 GNU libtool version 1.3
427 and if you have all this then you probably know enough to
428 go ahead yourself :-)
430 ----------------------
432 In the hope that it will be useful,
434 Robert Roebling <roebling@sun2.ruf.uni-freiburg.de>