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):
14 su <type root password>
19 On all other Unices (maybe except *BSD), shared libraries are not supported
20 out of the box due to the utter stupidity of libtool, so you'll have to do
23 ./configure --enable-static --disable-shared
25 su <type root password>
30 If you want to remove wxWindows on Unix you can do this:
32 su <type root password>
40 If you want to do some more serious cross-platform programming with wxWindows,
41 such as for GTK and Motif, you can now build two complete libraries and use
42 them concurretly. For this end, you have to create a directory for each build
43 of wxWindows - you may also want to create different versions of wxWindows
44 and test them concurrently. Most typically, this would be a version configured
45 with --enable-debug_flag and one without. Note, that only one build can currently
46 be installed, so you'd have to use local version of the library for that purpose.
47 For building three versions (one GTK, one Motif and a debug version of the GTK
48 source) you'd do this:
52 ../configure --with-motif
58 ../configure --with-gtk
64 ../configure --with-gtk --enable-debug_flag
68 * The most simple errors
69 ------------------------
71 configure reports, that you don't have GTK 1.X installed although you are
72 very sure you have. Well, you have installed it, but you also have another
73 version of the GTK installed, which you may need to remove including other
74 versions of glib (and its headers). Also, look for the PATH variable and check
75 if it includes the path to the correct gtk-config! The check your LDPATH if it
76 points to the correct library. There is no way to compile wxGTK if configure
77 doesn't pass this test as all this test does is compile and link a GTK program.
79 You get errors during compilation: The reason is that you probably have a broken
80 compiler, which includes almost everything that is called gcc. If you use gcc 2.8
81 you have to disable optimsation as the compiler will give up with an internal
84 If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
86 You get immediate segfault when starting any sample or application: This is either
87 due to having compiled the library with different flags or options than your program -
88 typically you might have the __WXDEBUG__ option set for the library but not for your
89 program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
91 * The most simple program
92 -------------------------
94 Now create your super-application myfoo.app and compile anywhere with
96 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
99 -----------------------
101 The Unix variants of wxWindows use GNU configure. If you have problems with your
102 make use GNU make instead.
104 If you have general problems with installation, read my homepage at
106 http://wesley.informatik.uni-freiburg.de/~wxxt
108 for newest information. If you still don't have any success, please send a bug
109 report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
110 YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT DISTRIBUTION
111 YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
114 -----------------------
116 wxWindows/GTK requires the GTK+ library to be installed on your system. It has to
117 be a stable version, preferebly version 1.2.3. You can use GTK 1.0 in connection
118 with wxWindows, albeit without Drag'n'Drop. wxWindows does work with the 1.1.X
119 versions of the GTK+ library.
121 You can get the newest version of the GTK+ from the GTK homepage at:
125 We also mirror GTK+ 1.0.6 at my ftp site. You'll find information about downloading
128 * Additional libraries
129 -----------------------
131 wxWindows/Gtk requires a thread library and X libraries known to work with threads.
132 This is the case on all commercial Unix-Variants and all Linux-Versions that are
133 based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing
134 this, these Linux distributions have correct glibc 2 support:
142 You can disable thread support by running
144 ./configure "--disable-threads"
146 su <type root password>
151 NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE ALL PROGRAMS WILL CRASH UPON
152 START-UP! Just always use egcs and be happy.
154 * Building wxGTK on OS/2
155 --------------------------
157 Please send comments and question about the OS/2 installation
158 to Andrea Venturoli <a.ventu@flashnet.it> and patches to
159 make the installation work (better) to me (Robert Roebling).
161 You'll need OS/2 Warp (4.00FP#6), X-Free86/2 (3.3.3),
162 gtk+ (?), emx (0.9d fix 1), flex (2.5.4), yacc (1.8),
163 korn shell (5.2.13), Autoconf (?), GNU file utilities (3.6),
164 GNU text utilities (1.3), GNU shell utilites (1.12), m4 (1.4),
165 sed (2.05), grep (2.0), Awk (3.0.3), GNU Make (3.76.1).
167 Open an OS/2 prompt and switch to the directory above.
168 First set some global environment variables we need:
170 SET CXXFLAGS=-Zmtd -D__ST_MT_ERRNO__
174 Notice you can choose whatever you want, if you don't like OS2X.
176 * Building wxGTK on SGI
177 --------------------------
179 Using the SGI native compilers, it is recommended that you
180 also set CFLAGS and CXXFLAGS before running configure. These
184 CXXFLAGS="-mips3 -n32"
186 This is essential if you want to use the resultant binaries
187 on any other machine than the one it was compiled on. If you
188 have a 64bit machine (Octane) you should also do this to ensure
189 you don't accidently build the libraries as 64bit (which is
192 The SGI native compiler support has only been tested on Irix 6.5.
194 * Create your configuration
195 -----------------------------
200 If you want to use system's C and C++ compiler,
201 set environment variables CC and CCC as
205 % ./configure options
207 to see all the options please use:
211 The basic philosophy is that if you want to use different
212 configurations, like a debug and a release version,
213 or use the same source tree on different systems,
214 you have only to change the environment variable OSTYPE.
215 (Sadly this variable is not set by default on some systems
216 in some shells - on SGI's for example). So you will have to
217 set it there. This variable HAS to be set before starting
218 configure, so that it knows which system it tries to
221 Configure will complain if the system variable OSTYPE has
222 not been defined. And Make in some circumstances as well...
228 Given below are the commands to change the default behaviour,
229 i.e. if it says "--disable-threads" it means that threads
230 are enabled by default.
232 Many of the confiugre options have been thoroughly tested
233 in wxWindows snapshot 6, but not yet all (ODBC not).
235 Normally, you won't have to choose a toolkit, because when
236 you download wxGTK, it will default to --with-gtk etc. But
237 if you use all of our CVS repository you have to choose a
238 toolkit. You must do this by running configure with either of:
240 --without-gtk Don't use the GIMP ToolKit (GTK)
242 --with-motif Use either Motif or Lesstif
243 Configure will look for both.
245 The following options handle the kind of library you want to build.
247 --disable-threads Compile without thread support. Threads
248 support is also required for the
251 --disable-shared Do not create shared libraries.
253 --disable-optimise Do not optimise the code. Can
254 sometimes be useful for debugging
255 and is required on some architectures
256 such as Sun with gcc 2.8.X which
257 would otherwise produce segvs.
259 --enable-profile Add profiling info to the object
260 files. Currently broken, I think.
262 --enable-no_rtti Enable compilation without creation of
263 C++ RTTI information in object files.
264 This will speed-up compilation and reduce
267 --enable-no_exceptions Enable compilation without creation of
268 C++ exception information in object files.
269 This will speed-up compilation and reduce
270 binary size. Also fewer crashes during the
271 actual compilation...
273 --enable-mem_tracing Add built-in memory tracing.
275 --enable-dmalloc Use the dmalloc memory debugger.
276 Read more at www.letters.com/dmalloc/
278 --enable-debug_info Add debug info to object files and
279 executables for use with debuggers
280 such as gdb (or its many frontends).
282 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
283 compiling. This enable wxWindows' very
284 useful internal debugging tricks (such
285 as automatically reporting illegal calls)
286 to work. Note that program and library
287 must be compiled with the same debug
293 Many of the confiugre options have been thoroughly tested
294 in wxWindows snapshot 6, but not yet all (ODBC not).
296 When producing an executable that is linked statically with wxGTK
297 you'll be surprised at its immense size. This can sometimes be
298 drastically reduced by removing features from wxWindows that
299 are not used in your program. The most relevant such features
302 --without-libpng Disables PNG image format code.
304 --without-libjpeg Disables JPEG image format code.
306 { --without-odbc Disables ODBC code. Not yet. }
308 --disable-resources Disables the use of *.wxr type
311 --disable-threads Disables threads. Will also
314 --disable-sockets Disables sockets.
316 --disable-dnd Disables Drag'n'Drop.
318 --disable-clipboard Disables Clipboard.
320 --disable-serial Disables object instance serialiasation.
322 --disable-streams Disables the wxStream classes.
324 --disable-file Disables the wxFile class.
326 --disable-textfile Disables the wxTextFile class.
328 --disable-intl Disables the internationalisation.
330 --disable-validators Disables validators.
332 --disable-accel Disables accel.
334 Apart from disabling certain features you can very often "strip"
335 the program of its debugging information resulting in a significant
341 The following must be done in the base directory (e.g. ~/wxGTK
342 or ~/wxWin or whatever)
344 Now the makefiles are created (by configure) and you can compile
345 the library by typing:
349 make yourself some coffee, as it will take some time. On an old
350 386SX possibly two weeks. During compilation, you'll get a few
351 warning messages depending in your compiler.
353 If you want to be more selective, you can change into a specific
354 directiry and type "make" there.
356 Then you may install the library and it's header files under
357 /usr/local/include/wx and /usr/local/lib respectively. You
358 have to log in as root (i.e. run "su" and enter the root
363 You can remove any traces of wxWindows by typing
367 If you want to save disk space by removing unnecessary
372 in the various directories will do the work for you.
374 * Creating a new Project
375 --------------------------
377 1) The first way uses the installed libraries and header files
378 automatically using wx-config
380 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
382 Using this way, a make file for the minimal sample would look
388 $(CC) -o minimal minimal.o `wx-config --libs`
390 minimal.o: minimal.cpp mondrian.xpm
391 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
396 This is certain to become the standard way unless we decide
399 2) The other way creates a project within the source code
400 directories of wxWindows. For this endeavour, you'll need
401 the usual number of GNU tools, at least
403 GNU automake version 1.4
404 GNU autoheader version 2.14
405 GNU autoconf version 2.14
406 GNU libtool version 1.3
413 and if you have all this then you probably know enough to
414 go ahead yourself :-)
416 ----------------------
418 In the hope that it will be useful,
420 Robert Roebling <roebling@sun2.ruf.uni-freiburg.de>