1 wxWindows 2.3 for X11 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 wxWindows you are
13 using (including the beta) and what compiler on what system. One
14 example: wxX11 2.3.0, egcs 1.1.1, Redhat 5.0
19 - Download wxWindows-X-x.y.z.tgz, where x.y.z is the version number.
20 Download documentation in a preferred format, such as
21 wxWindows-HTML.zip or wxWindows-PDF.zip.
23 - Make a directory such as ~/wx and unarchive the files into this
26 - It is recommended that you install bison and flex; using yacc
27 and lex may require tweaking of the makefiles. You also need
28 libXpm if you want to have XPM support in wxWindows (recommended).
30 - You can now use configure to build wxWindows and the samples.
32 Using configure is the recommended way to build the library. If it doesn't
33 work for you for whatever reason, please report it (together with detailed
34 information about your platform and the (relevant part of) contents of
35 config.log file) to wx-dev@lists.wxwindows.org.
37 COMPILING USING CONFIGURE
38 =========================
40 * The most simple case
41 -----------------------
43 If you compile wxWindows on Linux for the first time and don't like to read
44 install instructions just do (in the base dir):
46 > ./configure --with-x11
48 > su <type root password>
53 Afterwards you can continue with
56 > su <type root password>
61 If you want to remove wxWindows on Unix you can do this:
63 > su <type root password>
71 If you want to do some more serious cross-platform programming with wxWindows,
72 such as for GTK and X11, you can now build two complete libraries and use
73 them concurrently. For this end, you have to create a directory for each build
74 of wxWindows - you may also want to create different versions of wxWindows
75 and test them concurrently. Most typically, this would be a version configured
76 with --enable-debug_flag and one without. Note, that only one build can currently
77 be installed, so you'd have to use local version of the library for that purpose.
78 For building three versions (one GTK, one X11 and a debug version of the GTK
79 source) you'd do this:
83 ../configure --with-x11 --with-universal
89 ../configure --with-gtk
95 ../configure --with-gtk --enable-debug_flag
99 * The most simple errors
100 ------------------------
102 You get errors during compilation: The reason is that you probably have a broken
103 compiler, which includes almost everything that is called gcc. If you use gcc 2.8
104 you have to disable optimisation as the compiler will give up with an internal
107 If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
109 You get immediate segfault when starting any sample or application: This is either
110 due to having compiled the library with different flags or options than your program -
111 typically you might have the __WXDEBUG__ option set for the library but not for your
112 program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
114 * The most simple program
115 -------------------------
117 Now create your super-application myfoo.app and compile anywhere with
119 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
122 -----------------------
124 The Unix variants of wxWindows use GNU configure. If you have problems with your
125 make use GNU make instead.
127 If you have general problems with installation, read my homepage at
129 http://wesley.informatik.uni-freiburg.de/~wxxt
131 for newest information. If you still don't have any success, please send a bug
132 report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
133 YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT DISTRIBUTION
134 YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
137 -----------------------
139 wxWindows/X11 requires the X11 library to be installed on your system. As
140 an alternative, you may also use the free library "lesstif" which implements
141 most of the X11 API without the licence restrictions of X11.
143 You can get the newest version of the Lesstif from the lesstif homepage at:
145 http://www.lesstif.org
147 * Additional libraries
148 -----------------------
150 wxWindows/X11 requires a thread library and X libraries known to work with threads.
151 This is the case on all commercial Unix-Variants and all Linux-Versions that are
152 based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing
153 this, these Linux distributions have correct glibc 2 support:
161 You can disable thread support by running
163 ./configure "--disable-threads"
165 su <type root password>
170 NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE ALL PROGRAMS WILL
171 CRASH UPON START-UP! Just always use egcs and be happy.
173 * Building wxGTK on OS/2
174 --------------------------
176 Please send comments and question about the OS/2 installation
177 to Andrea Venturoli <a.ventu@flashnet.it> and patches to
178 the wxWindows mailing list.
180 You'll need OS/2 Warp (4.00FP#6), X-Free86/2 (3.3.3 or newer),
181 Lesstif (0.89.1 or newer), emx (0.9d fix 1), flex (2.5.4),
182 yacc (1.8), unix like shell, e.g. korn shell (5.2.13),
183 Autoconf (2.13), GNU file utilities (3.6),
184 GNU text utilities (1.3), GNU shell utilites (1.12), m4 (1.4),
185 sed (2.05), grep (2.0), Awk (3.0.3), GNU Make (3.76.1).
187 Open an OS/2 prompt and switch to the directory above.
188 First set some global environment variables we need:
190 SET CXXFLAGS=-Zmtd -D__ST_MT_ERRNO__
191 SET CFLAGS=-Zmtd -D__ST_MT_ERRNO__
195 Notice you can choose whatever you want, if you don't like OS2X.
197 Now, run autoconf in the main directory and in the samples, demos
198 and utils subdirectory. This will generate the OS/2 specific
199 versions of the configure scripts. Now run
203 To verify Lesstif installation, configure will try to compile a
204 sample program that requires X headers/libraries to be either
205 available via C_INCLUDE_PATH and LIBRARY_PATH or you need to
206 explicitly set CFLAGS prior to running configure.
208 If you have pthreads library installed, it will be autodetected
209 and the library will be compiled with thread-support.
211 Note that configure assumes your flex will generate files named
212 "lexyy.c", not "lex.yy.c". If you have a version which does
213 generate "lex.yy.c", you need to manually change the generated
216 * Building wxX11 on SGI
217 --------------------------
219 Using the SGI native compilers, it is recommended that you
220 also set CFLAGS and CXXFLAGS before running configure. These
224 CXXFLAGS="-mips3 -n32"
226 This is essential if you want to use the resultant binaries
227 on any other machine than the one it was compiled on. If you
228 have a 64bit machine (Octane) you should also do this to ensure
229 you don't accidently build the libraries as 64bit (which is
232 The SGI native compiler support has only been tested on Irix 6.5.
234 * Create your configuration
235 -----------------------------
240 If you want to use system's C and C++ compiler,
241 set environment variables CXX and CC as
245 % ./configure options
247 to see all the options please use:
251 The basic philosophy is that if you want to use different
252 configurations, like a debug and a release version,
253 or use the same source tree on different systems,
254 you have only to change the environment variable OSTYPE.
255 (Sadly this variable is not set by default on some systems
256 in some shells - on SGI's for example). So you will have to
257 set it there. This variable HAS to be set before starting
258 configure, so that it knows which system it tries to
261 Configure will complain if the system variable OSTYPE has
262 not been defined. And Make in some circumstances as well...
268 Given below are the commands to change the default behaviour,
269 i.e. if it says "--disable-threads" it means that threads
270 are enabled by default.
272 Many of the configure options have been thoroughly tested
273 in wxWindows snapshot 6, but not yet all (ODBC not).
275 You have to add --with-x11 on platforms, where X11 is
276 not the default (on Linux, configure will default to GTK).
278 --without-gtk Don't use the GIMP ToolKit (GTK).
282 --with-universal Needs to be specified with X11.
284 The following options handle the kind of library you want to build.
286 --disable-threads Compile without thread support. Threads
287 support is also required for the
290 --disable-shared Do not create shared libraries.
292 --disable-optimise Do not optimise the code. Can
293 sometimes be useful for debugging
294 and is required on some architectures
295 such as Sun with gcc 2.8.X which
296 would otherwise produce segvs.
298 --enable-profile Add profiling info to the object
299 files. Currently broken, I think.
301 --enable-no_rtti Enable compilation without creation of
302 C++ RTTI information in object files.
303 This will speed-up compilation and reduce
306 --enable-no_exceptions Enable compilation without creation of
307 C++ exception information in object files.
308 This will speed-up compilation and reduce
309 binary size. Also fewer crashes during the
310 actual compilation...
312 --enable-no_deps Enable compilation without creation of
313 dependency information.
315 --enable-permissive Enable compilation without checking for strict
316 ANSI conformance. Useful to prevent the build
317 dying with errors as soon as you compile with
318 Solaris' ANSI-defying headers.
320 --enable-mem_tracing Add built-in memory tracing.
322 --enable-dmalloc Use the dmalloc memory debugger.
323 Read more at www.letters.com/dmalloc/
325 --enable-debug_info Add debug info to object files and
326 executables for use with debuggers
327 such as gdb (or its many frontends).
329 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
330 compiling. This enable wxWindows' very
331 useful internal debugging tricks (such
332 as automatically reporting illegal calls)
333 to work. Note that program and library
334 must be compiled with the same debug
340 Many of the configure options have been thoroughly tested
341 in wxWindows snapshot 6, but not yet all (ODBC not).
343 When producing an executable that is linked statically with wxGTK
344 you'll be surprised at its immense size. This can sometimes be
345 drastically reduced by removing features from wxWindows that
346 are not used in your program. The most relevant such features
349 --without-libpng Disables PNG image format code.
351 --without-libjpeg Disables JPEG image format code.
353 { --without-odbc Disables ODBC code. Not yet. }
355 --disable-resources Disables the use of *.wxr type
358 --disable-threads Disables threads. Will also
361 --disable-sockets Disables sockets.
363 --disable-dnd Disables Drag'n'Drop.
365 --disable-clipboard Disables Clipboard.
367 --disable-serial Disables object instance serialisation.
369 --disable-streams Disables the wxStream classes.
371 --disable-file Disables the wxFile class.
373 --disable-textfile Disables the wxTextFile class.
375 --disable-intl Disables the internationalisation.
377 --disable-validators Disables validators.
379 --disable-accel Disables accel.
381 Apart from disabling certain features you can very often "strip"
382 the program of its debugging information resulting in a significant
388 The following must be done in the base directory (e.g. ~/wxGTK
389 or ~/wxWin or whatever)
391 Now the makefiles are created (by configure) and you can compile
392 the library by typing:
396 make yourself some coffee, as it will take some time. On an old
397 386SX possibly two weeks. During compilation, you'll get a few
398 warning messages depending in your compiler.
400 If you want to be more selective, you can change into a specific
401 directory and type "make" there.
403 Then you may install the library and its header files under
404 /usr/local/include/wx and /usr/local/lib respectively. You
405 have to log in as root (i.e. run "su" and enter the root
410 You can remove any traces of wxWindows by typing
414 If you want to save disk space by removing unnecessary
419 in the various directories will do the work for you.
421 * Creating a new Project
422 --------------------------
424 1) The first way uses the installed libraries and header files
425 automatically using wx-config
427 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
429 Using this way, a make file for the minimal sample would look
435 $(CXX) -o minimal minimal.o `wx-config --libs`
437 minimal.o: minimal.cpp mondrian.xpm
438 $(CXX) `wx-config --cflags` -c minimal.cpp -o minimal.o
443 This is certain to become the standard way unless we decide
446 2) The other way creates a project within the source code
447 directories of wxWindows. For this endeavour, you'll need
448 GNU autoconf version 2.14 and add an entry to your Makefile.in
449 to the bottom of the configure.in script and run autoconf
450 and configure before you can type make.
452 * Further notes by Julian Smart
453 ---------------------------------
455 - You may find the following script useful for compiling wxX11,
456 especially if installing from zips (which don't preserve file
457 permissions). Make this script executable with the command
460 -------:x-----Cut here-----:x-----
462 # Sets permissions (in case we extracted wxX11 from zip files)
464 # Call from top-level wxWindows directory.
465 # Note that this uses standard (but commonly-used) configure options;
466 # if you're feeling brave, you may wish to compile with threads:
467 # if they're not supported by the target platform, they will be disabled
470 chmod a+x configure config.sub config.guess
471 ./configure --with-shared --with-x11 --with-universal --without-gtk --with-debug_flag --with-debug_info --enable-debug --without-threads --without-sockets --without-odbc
473 -------:x-----Cut here-----:x-----
475 This script will build wxX11 using shared libraries. If you want to build
476 a static wxWindows library, use --disable-shared.
481 - Solaris compilation with gcc: if the compiler has problems with the variable argument
482 functions, try putting the gcc fixinclude file paths early in the include
485 - If you operator-related compile errors or strange memory problems
486 (for example in deletion of string arrays), set wxUSE_GLOBAL_MEMORY_OPERATORS
487 and wxUSE_MEMORY_TRACING to 0 in setup.h, and recompile.
489 - If you get an internal compiler error in gcc, turn off optimisations.
491 - Some compilers, such as Sun C++, may give a lot of warnings about
492 virtual functions being hidden. Please ignore these, it's correct C++ syntax.
493 If you find any incorrect instances, though, such as a
494 missing 'const' in an overridden function, please let us know.
499 - Debugging mode is switched on by default in the makefiles, but using
500 configure will create a release build of the library by default: it's
501 recommended to use --with-debug_info and --with-debug_flag configure
502 switches while developing your application. To compile in non-debug
503 mode, remove the -D__WXDEBUG__ switch in make.env (or if using the
504 configure system, change --with-debug_flag to --without_debug_flag
505 and --with-debug_info to --without-debug_info in the makewxx11
511 Please send bug reports with a description of your environment,
512 compiler and the error message(s) to the wxwin-developers mailing list at:
514 wx-dev@lists.wxwindows.org
516 Julian Smart, Robert Roebling and Vadim Zeitlin, February 2002.