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 Afterwards you can continue with
22 > su <type root password>
27 If you want to remove wxWindows on Unix you can do this:
29 > su <type root password>
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.
44 For building three versions (one GTK, one Motif and a debug version of the GTK
45 source) you'd do this:
49 ../configure --with-motif
55 ../configure --with-gtk
61 ../configure --with-gtk --enable-debug_flag
65 * The most simple errors
66 ------------------------
68 configure reports, that you don't have GTK 1.2 installed although you are
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
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.
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
81 If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
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.
88 * The most simple program
89 -------------------------
91 Now create your super-application myfoo.app and compile anywhere with
93 gcc myfoo.cpp `wx-config --libs --cflags` -o myfoo
96 -----------------------
98 The Unix variants of wxWindows use GNU configure. If you have problems with your
99 make use GNU make instead.
101 If you have general problems with installation, read my homepage at
103 http://wesley.informatik.uni-freiburg.de/~wxxt
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...
111 -----------------------
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.
116 You can get the newest version of the GTK+ from the GTK homepage at:
120 We also mirror GTK+ 1.2.3 at my ftp site. You'll find information about downloading
123 * Additional libraries
124 -----------------------
126 wxWindows/Gtk requires a thread library and X libraries known to work with threads.
127 This is the case on all commercial Unix-Variants and all Linux-Versions that are
128 based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing
129 this, these Linux distributions have correct glibc 2 support:
137 You can disable thread support by running
139 ./configure "--disable-threads"
141 su <type root password>
146 NB: DO NOT COMPILE WXGTK WITH GCC 2.7 AND THREADS, SINCE ALL PROGRAMS WILL CRASH UPON
147 START-UP! Just always use egcs and be happy.
149 * Building wxGTK on OS/2
150 --------------------------
152 Please send comments and question about the OS/2 installation
153 to Andrea Venturoli <a.ventu@flashnet.it> and patches to
154 the wxWindows mailing list.
156 You'll need OS/2 Warp (4.00FP#6), X-Free86/2 (3.3.3 or newer),
157 GTK+ (1.2.5 or newer), emx (0.9d fix 1), flex (2.5.4), yacc (1.8),
158 korn shell (5.2.13), Autoconf (2.13), GNU file utilities (3.6),
159 GNU text utilities (1.3), GNU shell utilites (1.12), m4 (1.4),
160 sed (2.05), grep (2.0), Awk (3.0.3), GNU Make (3.76.1).
162 Open an OS/2 prompt and switch to the directory above.
163 First set some global environment variables we need:
165 SET CXXFLAGS=-Zmtd -D__ST_MT_ERRNO__
166 SET CFLAGS=-Zmtd -D__ST_MT_ERRNO__
170 Notice you can choose whatever you want, if you don't like OS2X.
172 Now, run autoconf in the main directory and in the samples, demos
173 and utils subdirectory. This will generate the OS/2 specific
174 versions of the configure scripts. Now run
178 If you have pthreads library installed, but have a gtk version
179 which does not yet support threading, you need to explicitly
180 diable threading by using the option --disable-threads.
182 Note that configure assumes your flex will generate files named
183 "lexyy.c", not "lex.yy.c". If you have a version which does
184 generate "lex.yy.c", you need to manually change the generated
187 * Building wxGTK on SGI
188 --------------------------
190 Using the SGI native compilers, it is recommended that you
191 also set CFLAGS and CXXFLAGS before running configure. These
195 CXXFLAGS="-mips3 -n32"
197 This is essential if you want to use the resultant binaries
198 on any other machine than the one it was compiled on. If you
199 have a 64bit machine (Octane) you should also do this to ensure
200 you don't accidently build the libraries as 64bit (which is
203 The SGI native compiler support has only been tested on Irix 6.5.
205 * Create your configuration
206 -----------------------------
211 If you want to use system's C and C++ compiler,
212 set environment variables CC and CCC as
216 % ./configure options
218 to see all the options please use:
222 The basic philosophy is that if you want to use different
223 configurations, like a debug and a release version,
224 or use the same source tree on different systems,
225 you have only to change the environment variable OSTYPE.
226 (Sadly this variable is not set by default on some systems
227 in some shells - on SGI's for example). So you will have to
228 set it there. This variable HAS to be set before starting
229 configure, so that it knows which system it tries to
232 Configure will complain if the system variable OSTYPE has
233 not been defined. And Make in some circumstances as well...
239 Given below are the commands to change the default behaviour,
240 i.e. if it says "--disable-threads" it means that threads
241 are enabled by default.
243 Many of the confiugre options have been thoroughly tested
244 in wxWindows snapshot 6, but not yet all (ODBC not).
246 Normally, you won't have to choose a toolkit, because when
247 you download wxGTK, it will default to --with-gtk etc. But
248 if you use all of our CVS repository you have to choose a
249 toolkit. You must do this by running configure with either of:
251 --without-gtk Don't use the GIMP ToolKit (GTK)
253 --with-motif Use either Motif or Lesstif
254 Configure will look for both.
256 The following options handle the kind of library you want to build.
258 --disable-threads Compile without thread support.
260 --disable-shared Do not create shared libraries.
262 --enable-static Create static libraries.
264 --disable-optimise Do not optimise the code. Can
265 sometimes be useful for debugging
266 and is required on some architectures
267 such as Sun with gcc 2.8.X which
268 would otherwise produce segvs.
270 --enable-profile Add profiling info to the object
271 files. Currently broken, I think.
273 --enable-no_rtti Enable compilation without creation of
274 C++ RTTI information in object files.
275 This will speed-up compilation and reduce
278 --enable-no_exceptions Enable compilation without creation of
279 C++ exception information in object files.
280 This will speed-up compilation and reduce
281 binary size. Also fewer crashes during the
282 actual compilation...
284 --enable-no_deps Enable compilation without creation of
285 dependency information.
287 --enable-permissive Enable compilation without creation of
288 giving erros as soon as you compile with
289 Solaris' ANSI-defying headers...
291 --enable-mem_tracing Add built-in memory tracing.
293 --enable-dmalloc Use the dmalloc memory debugger.
294 Read more at www.letters.com/dmalloc/
296 --enable-debug_info Add debug info to object files and
297 executables for use with debuggers
298 such as gdb (or its many frontends).
300 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
301 compiling. This enable wxWindows' very
302 useful internal debugging tricks (such
303 as automatically reporting illegal calls)
304 to work. Note that program and library
305 must be compiled with the same debug
311 Many of the confiugre options have been thoroughly tested
312 in wxWindows snapshot 6, but not yet all (ODBC not).
314 When producing an executable that is linked statically with wxGTK
315 you'll be surprised at its immense size. This can sometimes be
316 drastically reduced by removing features from wxWindows that
317 are not used in your program. The most relevant such features
320 --without-libpng Disables PNG image format code.
322 --without-libjpeg Disables JPEG image format code.
324 --disable-pnm Disables PNM image format code.
326 --disable-gif Disables GIF image format code.
328 --disable-pcx Disables PCX image format code.
330 --without-odbc Disables ODBC code.
332 --disable-resources Disables the use of *.wxr type
335 --disable-threads Disables threads. Will also
338 --disable-sockets Disables sockets.
340 --disable-dnd Disables Drag'n'Drop.
342 --disable-clipboard Disables Clipboard.
344 --disable-serial Disables object instance serialiasation.
346 --disable-streams Disables the wxStream classes.
348 --disable-file Disables the wxFile class.
350 --disable-textfile Disables the wxTextFile class.
352 --disable-intl Disables the internationalisation.
354 --disable-validators Disables validators.
356 --disable-accel Disables accel.
358 Apart from disabling certain features you can very often "strip"
359 the program of its debugging information resulting in a significant
365 The following must be done in the base directory (e.g. ~/wxGTK
366 or ~/wxWin or whatever)
368 Now the makefiles are created (by configure) and you can compile
369 the library by typing:
373 make yourself some coffee, as it will take some time. On an old
374 386SX possibly two weeks. During compilation, you'll get a few
375 warning messages depending in your compiler.
377 If you want to be more selective, you can change into a specific
378 directiry and type "make" there.
380 Then you may install the library and it's header files under
381 /usr/local/include/wx and /usr/local/lib respectively. You
382 have to log in as root (i.e. run "su" and enter the root
387 You can remove any traces of wxWindows by typing
391 If you want to save disk space by removing unnecessary
396 in the various directories will do the work for you.
398 * Creating a new Project
399 --------------------------
401 1) The first way uses the installed libraries and header files
402 automatically using wx-config
404 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
406 Using this way, a make file for the minimal sample would look
412 $(CC) -o minimal minimal.o `wx-config --libs`
414 minimal.o: minimal.cpp mondrian.xpm
415 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
420 This is certain to become the standard way unless we decide
423 2) The other way creates a project within the source code
424 directories of wxWindows. For this endeavour, you'll need
425 GNU autoconf version 2.14 and add an entry to your Makefile.in
426 to the bottom of the configure.in script and run autoconf
427 and configure before you can type make.
429 ----------------------
431 In the hope that it will be useful,