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: wxMotif 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-motif
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 You get errors during compilation: The reason is that you probably have a broken
69 compiler, which includes almost everything that is called gcc. If you use gcc 2.8
70 you have to disable optimsation as the compiler will give up with an internal
73 If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
75 You get immediate segfault when starting any sample or application: This is either
76 due to having compiled the library with different flags or options than your program -
77 typically you might have the __WXDEBUG__ option set for the library but not for your
78 program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
80 * The most simple program
81 -------------------------
83 Now create your super-application myfoo.app and compile anywhere with
85 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
88 -----------------------
90 The Unix variants of wxWindows use GNU configure. If you have problems with your
91 make use GNU make instead.
93 If you have general problems with installation, read my homepage at
95 http://wesley.informatik.uni-freiburg.de/~wxxt
97 for newest information. If you still don't have any success, please send a bug
98 report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
99 YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT DISTRIBUTION
100 YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
103 -----------------------
105 wxWindows/Motif requires the Motif library to be installed on your system. As
106 an alternative, you may also use the free library "lesstif" which implements
107 most of the Motif API without the licence restrictions of Motif.
109 You can get the newest version of the Lesstif from the lesstif homepage at:
111 http://www.lesstif.org
113 * Additional libraries
114 -----------------------
116 wxWindows/Motif requires a thread library and X libraries known to work with threads.
117 This is the case on all commercial Unix-Variants and all Linux-Versions that are
118 based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing
119 this, these Linux distributions have correct glibc 2 support:
127 You can disable thread support by running
129 ./configure "--disable-threads"
131 su <type root password>
136 NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE ALL PROGRAMS WILL CRASH UPON
137 START-UP! Just always use egcs and be happy.
139 * Building wxGTK on OS/2
140 --------------------------
142 Please send comments and question about the OS/2 installation
143 to Andrea Venturoli <a.ventu@flashnet.it> and patches to
144 the wxWindows mailing list.
146 You'll need OS/2 Warp (4.00FP#6), X-Free86/2 (3.3.3 or newer),
147 Lesstif (0.89.1 or newer), emx (0.9d fix 1), flex (2.5.4),
148 yacc (1.8), unix like shell, e.g. korn shell (5.2.13),
149 Autoconf (2.13), GNU file utilities (3.6),
150 GNU text utilities (1.3), GNU shell utilites (1.12), m4 (1.4),
151 sed (2.05), grep (2.0), Awk (3.0.3), GNU Make (3.76.1).
153 Open an OS/2 prompt and switch to the directory above.
154 First set some global environment variables we need:
156 SET CXXFLAGS=-Zmtd -D__ST_MT_ERRNO__
157 SET CFLAGS=-Zmtd -D__ST_MT_ERRNO__
161 Notice you can choose whatever you want, if you don't like OS2X.
163 Now, run autoconf in the main directory and in the samples, demos
164 and utils subdirectory. This will generate the OS/2 specific
165 versions of the configure scripts. Now run
166 configure --with-motif
169 To verify Lesstif installation, configure will try to compile a
170 sample program that requires X headers/libraries to be either
171 available via C_INCLUDE_PATH and LIBRARY_PATH or you need to
172 explicitly set CFLAGS prior to running configure.
174 If you have pthreads library installed, it will be autodetected
175 and the library will be compiled with thread-support.
177 Note that configure assumes your flex will generate files named
178 "lexyy.c", not "lex.yy.c". If you have a version which does
179 generate "lex.yy.c", you need to manually change the generated
182 * Building wxMotif on SGI
183 --------------------------
185 Using the SGI native compilers, it is recommended that you
186 also set CFLAGS and CXXFLAGS before running configure. These
190 CXXFLAGS="-mips3 -n32"
192 This is essential if you want to use the resultant binaries
193 on any other machine than the one it was compiled on. If you
194 have a 64bit machine (Octane) you should also do this to ensure
195 you don't accidently build the libraries as 64bit (which is
198 The SGI native compiler support has only been tested on Irix 6.5.
200 * Create your configuration
201 -----------------------------
206 If you want to use system's C and C++ compiler,
207 set environment variables CC and CCC as
211 % ./configure options
213 to see all the options please use:
217 The basic philosophy is that if you want to use different
218 configurations, like a debug and a release version,
219 or use the same source tree on different systems,
220 you have only to change the environment variable OSTYPE.
221 (Sadly this variable is not set by default on some systems
222 in some shells - on SGI's for example). So you will have to
223 set it there. This variable HAS to be set before starting
224 configure, so that it knows which system it tries to
227 Configure will complain if the system variable OSTYPE has
228 not been defined. And Make in some circumstances as well...
234 Given below are the commands to change the default behaviour,
235 i.e. if it says "--disable-threads" it means that threads
236 are enabled by default.
238 Many of the confiugre options have been thoroughly tested
239 in wxWindows snapshot 6, but not yet all (ODBC not).
241 You have to add --with-motif on platforms, where Motif is
242 not the default (on Linux, configure will deafult to GTK).
244 --without-gtk Don't use the GIMP ToolKit (GTK)
246 --with-motif Use either Motif or Lesstif
247 Configure will look for both.
249 The following options handle the kind of library you want to build.
251 --disable-threads Compile without thread support. Threads
252 support is also required for the
255 --disable-shared Do not create shared libraries.
257 --disable-optimise Do not optimise the code. Can
258 sometimes be useful for debugging
259 and is required on some architectures
260 such as Sun with gcc 2.8.X which
261 would otherwise produce segvs.
263 --enable-profile Add profiling info to the object
264 files. Currently broken, I think.
266 --enable-no_rtti Enable compilation without creation of
267 C++ RTTI information in object files.
268 This will speed-up compilation and reduce
271 --enable-no_exceptions Enable compilation without creation of
272 C++ exception information in object files.
273 This will speed-up compilation and reduce
274 binary size. Also fewer crashes during the
275 actual compilation...
277 --enable-no_deps Enable compilation without creation of
278 dependency information.
280 --enable-permissive Enable compilation without creation of
281 giving erros as soon as you compile with
282 Solaris ANSI-defying headers...
284 --enable-mem_tracing Add built-in memory tracing.
286 --enable-dmalloc Use the dmalloc memory debugger.
287 Read more at www.letters.com/dmalloc/
289 --enable-debug_info Add debug info to object files and
290 executables for use with debuggers
291 such as gdb (or its many frontends).
293 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
294 compiling. This enable wxWindows' very
295 useful internal debugging tricks (such
296 as automatically reporting illegal calls)
297 to work. Note that program and library
298 must be compiled with the same debug
304 Many of the confiugre options have been thoroughly tested
305 in wxWindows snapshot 6, but not yet all (ODBC not).
307 When producing an executable that is linked statically with wxGTK
308 you'll be surprised at its immense size. This can sometimes be
309 drastically reduced by removing features from wxWindows that
310 are not used in your program. The most relevant such features
313 --without-libpng Disables PNG image format code.
315 --without-libjpeg Disables JPEG image format code.
317 { --without-odbc Disables ODBC code. Not yet. }
319 --disable-resources Disables the use of *.wxr type
322 --disable-threads Disables threads. Will also
325 --disable-sockets Disables sockets.
327 --disable-dnd Disables Drag'n'Drop.
329 --disable-clipboard Disables Clipboard.
331 --disable-serial Disables object instance serialiasation.
333 --disable-streams Disables the wxStream classes.
335 --disable-file Disables the wxFile class.
337 --disable-textfile Disables the wxTextFile class.
339 --disable-intl Disables the internationalisation.
341 --disable-validators Disables validators.
343 --disable-accel Disables accel.
345 Apart from disabling certain features you can very often "strip"
346 the program of its debugging information resulting in a significant
352 The following must be done in the base directory (e.g. ~/wxGTK
353 or ~/wxWin or whatever)
355 Now the makefiles are created (by configure) and you can compile
356 the library by typing:
360 make yourself some coffee, as it will take some time. On an old
361 386SX possibly two weeks. During compilation, you'll get a few
362 warning messages depending in your compiler.
364 If you want to be more selective, you can change into a specific
365 directiry and type "make" there.
367 Then you may install the library and it's header files under
368 /usr/local/include/wx and /usr/local/lib respectively. You
369 have to log in as root (i.e. run "su" and enter the root
374 You can remove any traces of wxWindows by typing
378 If you want to save disk space by removing unnecessary
383 in the various directories will do the work for you.
385 * Creating a new Project
386 --------------------------
388 1) The first way uses the installed libraries and header files
389 automatically using wx-config
391 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
393 Using this way, a make file for the minimal sample would look
399 $(CC) -o minimal minimal.o `wx-config --libs`
401 minimal.o: minimal.cpp mondrian.xpm
402 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
407 This is certain to become the standard way unless we decide
410 2) The other way creates a project within the source code
411 directories of wxWindows. For this endeavour, you'll need
412 GNU autoconf version 2.14 and add an entry to your Makefile.in
413 to the bottom of the configure.in script and run autoconf
414 and configure before you can type make.
417 ----------------------
419 In the hope that it will be useful,
421 Robert Roebling <roebling@sun2.ruf.uni-freiburg.de>