1 wxWindows 2.3 for Motif 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: wxMotif 2.3.0, egcs 1.1.1, Redhat 5.0
19 - Prerequisites: Motif 1.2 or above, or Lesstif
20 (not yet tested). Motif 2.0 and above may also be suitable.
22 - Download wxMotif-x.y.z.tgz, where x.y.z is the version number.
23 Download documentation in a preferred format, such as
24 wxWindows-HTML.zip or wxWindows-PDF.zip.
26 - Make a directory such as ~/wx and unarchive the files into this
29 - It is recommended that you install bison and flex; using yacc
30 and lex may require tweaking of the makefiles. You also need
31 libXpm (see comments in the Notes section below) if you want to have
32 XPM support in wxWindows (recommended).
34 - You can now use configure to build wxWindows and the samples.
36 Using configure is the recommended way to build the library. If it doesn't
37 work for you for whatever reason, please report it (together with detailed
38 information about your platform and the (relevant part of) contents of
39 config.log file) to wx-dev@lists.wxwindows.org.
42 COMPILING USING CONFIGURE
43 =========================
45 * The most simple case
46 -----------------------
48 If you compile wxWindows on Linux for the first time and don't like to read
49 install instructions just do (in the base dir):
51 > ./configure --with-motif
53 > su <type root password>
58 Afterwards you can continue with
61 > su <type root password>
66 If you want to remove wxWindows on Unix you can do this:
68 > su <type root password>
76 If you want to do some more serious cross-platform programming with wxWindows,
77 such as for GTK and Motif, you can now build two complete libraries and use
78 them concurrently. For this end, you have to create a directory for each build
79 of wxWindows - you may also want to create different versions of wxWindows
80 and test them concurrently. Most typically, this would be a version configured
81 with --enable-debug_flag and one without. Note, that only one build can currently
82 be installed, so you'd have to use local version of the library for that purpose.
83 For building three versions (one GTK, one Motif and a debug version of the GTK
84 source) you'd do this:
88 ../configure --with-motif
94 ../configure --with-gtk
100 ../configure --with-gtk --enable-debug_flag
104 * The most simple errors
105 ------------------------
107 You get errors during compilation: The reason is that you probably have a broken
108 compiler, which includes almost everything that is called gcc. If you use gcc 2.8
109 you have to disable optimisation as the compiler will give up with an internal
112 If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
114 You get immediate segfault when starting any sample or application: This is either
115 due to having compiled the library with different flags or options than your program -
116 typically you might have the __WXDEBUG__ option set for the library but not for your
117 program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
119 * The most simple program
120 -------------------------
122 Now create your super-application myfoo.app and compile anywhere with
124 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
127 -----------------------
129 The Unix variants of wxWindows use GNU configure. If you have problems with your
130 make use GNU make instead.
132 If you have general problems with installation, read my homepage at
134 http://wesley.informatik.uni-freiburg.de/~wxxt
136 for newest information. If you still don't have any success, please send a bug
137 report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
138 YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT DISTRIBUTION
139 YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
142 -----------------------
144 wxWindows/Motif requires the Motif library to be installed on your system. As
145 an alternative, you may also use the free library "lesstif" which implements
146 most of the Motif API without the licence restrictions of Motif.
148 You can get the newest version of the Lesstif from the lesstif homepage at:
150 http://www.lesstif.org
152 * Additional libraries
153 -----------------------
155 wxWindows/Motif requires a thread library and X libraries known to work with threads.
156 This is the case on all commercial Unix-Variants and all Linux-Versions that are
157 based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing
158 this, these Linux distributions have correct glibc 2 support:
166 You can disable thread support by running
168 ./configure "--disable-threads"
170 su <type root password>
175 NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE ALL PROGRAMS WILL
176 CRASH UPON START-UP! Just always use egcs and be happy.
178 * Building wxGTK on OS/2
179 --------------------------
181 Please send comments and question about the OS/2 installation
182 to Andrea Venturoli <a.ventu@flashnet.it> and patches to
183 the wxWindows mailing list.
185 You'll need OS/2 Warp (4.00FP#6), X-Free86/2 (3.3.3 or newer),
186 Lesstif (0.89.1 or newer), emx (0.9d fix 1), flex (2.5.4),
187 yacc (1.8), unix like shell, e.g. korn shell (5.2.13),
188 Autoconf (2.13), GNU file utilities (3.6),
189 GNU text utilities (1.3), GNU shell utilites (1.12), m4 (1.4),
190 sed (2.05), grep (2.0), Awk (3.0.3), GNU Make (3.76.1).
192 Open an OS/2 prompt and switch to the directory above.
193 First set some global environment variables we need:
195 SET CXXFLAGS=-Zmtd -D__ST_MT_ERRNO__
196 SET CFLAGS=-Zmtd -D__ST_MT_ERRNO__
200 Notice you can choose whatever you want, if you don't like OS2X.
202 Now, run autoconf in the main directory and in the samples, demos
203 and utils subdirectory. This will generate the OS/2 specific
204 versions of the configure scripts. Now run
205 configure --with-motif
208 To verify Lesstif installation, configure will try to compile a
209 sample program that requires X headers/libraries to be either
210 available via C_INCLUDE_PATH and LIBRARY_PATH or you need to
211 explicitly set CFLAGS prior to running configure.
213 If you have pthreads library installed, it will be autodetected
214 and the library will be compiled with thread-support.
216 Note that configure assumes your flex will generate files named
217 "lexyy.c", not "lex.yy.c". If you have a version which does
218 generate "lex.yy.c", you need to manually change the generated
221 * Building wxMotif on SGI
222 --------------------------
224 Using the SGI native compilers, it is recommended that you
225 also set CFLAGS and CXXFLAGS before running configure. These
229 CXXFLAGS="-mips3 -n32"
231 This is essential if you want to use the resultant binaries
232 on any other machine than the one it was compiled on. If you
233 have a 64bit machine (Octane) you should also do this to ensure
234 you don't accidently build the libraries as 64bit (which is
237 The SGI native compiler support has only been tested on Irix 6.5.
239 * Create your configuration
240 -----------------------------
245 If you want to use system's C and C++ compiler,
246 set environment variables CXX and CC as
250 % ./configure options
252 to see all the options please use:
256 The basic philosophy is that if you want to use different
257 configurations, like a debug and a release version,
258 or use the same source tree on different systems,
259 you have only to change the environment variable OSTYPE.
260 (Sadly this variable is not set by default on some systems
261 in some shells - on SGI's for example). So you will have to
262 set it there. This variable HAS to be set before starting
263 configure, so that it knows which system it tries to
266 Configure will complain if the system variable OSTYPE has
267 not been defined. And Make in some circumstances as well...
273 Given below are the commands to change the default behaviour,
274 i.e. if it says "--disable-threads" it means that threads
275 are enabled by default.
277 Many of the configure options have been thoroughly tested
278 in wxWindows snapshot 6, but not yet all (ODBC not).
280 You have to add --with-motif on platforms, where Motif is
281 not the default (on Linux, configure will default to GTK).
283 --without-gtk Don't use the GIMP ToolKit (GTK)
285 --with-motif Use either Motif or Lesstif
286 Configure will look for both.
288 The following options handle the kind of library you want to build.
290 --disable-threads Compile without thread support. Threads
291 support is also required for the
294 --disable-shared Do not create shared libraries.
296 --disable-optimise Do not optimise the code. Can
297 sometimes be useful for debugging
298 and is required on some architectures
299 such as Sun with gcc 2.8.X which
300 would otherwise produce segvs.
302 --enable-profile Add profiling info to the object
303 files. Currently broken, I think.
305 --enable-no_rtti Enable compilation without creation of
306 C++ RTTI information in object files.
307 This will speed-up compilation and reduce
310 --enable-no_exceptions Enable compilation without creation of
311 C++ exception information in object files.
312 This will speed-up compilation and reduce
313 binary size. Also fewer crashes during the
314 actual compilation...
316 --enable-no_deps Enable compilation without creation of
317 dependency information.
319 --enable-permissive Enable compilation without checking for strict
320 ANSI conformance. Useful to prevent the build
321 dying with errors as soon as you compile with
322 Solaris' ANSI-defying headers.
324 --enable-mem_tracing Add built-in memory tracing.
326 --enable-dmalloc Use the dmalloc memory debugger.
327 Read more at www.letters.com/dmalloc/
329 --enable-debug_info Add debug info to object files and
330 executables for use with debuggers
331 such as gdb (or its many frontends).
333 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
334 compiling. This enable wxWindows' very
335 useful internal debugging tricks (such
336 as automatically reporting illegal calls)
337 to work. Note that program and library
338 must be compiled with the same debug
344 Many of the configure options have been thoroughly tested
345 in wxWindows snapshot 6, but not yet all (ODBC not).
347 When producing an executable that is linked statically with wxGTK
348 you'll be surprised at its immense size. This can sometimes be
349 drastically reduced by removing features from wxWindows that
350 are not used in your program. The most relevant such features
353 --without-libpng Disables PNG image format code.
355 --without-libjpeg Disables JPEG image format code.
357 { --without-odbc Disables ODBC code. Not yet. }
359 --disable-resources Disables the use of *.wxr type
362 --disable-threads Disables threads. Will also
365 --disable-sockets Disables sockets.
367 --disable-dnd Disables Drag'n'Drop.
369 --disable-clipboard Disables Clipboard.
371 --disable-serial Disables object instance serialisation.
373 --disable-streams Disables the wxStream classes.
375 --disable-file Disables the wxFile class.
377 --disable-textfile Disables the wxTextFile class.
379 --disable-intl Disables the internationalisation.
381 --disable-validators Disables validators.
383 --disable-accel Disables accel.
385 Apart from disabling certain features you can very often "strip"
386 the program of its debugging information resulting in a significant
392 The following must be done in the base directory (e.g. ~/wxGTK
393 or ~/wxWin or whatever)
395 Now the makefiles are created (by configure) and you can compile
396 the library by typing:
400 make yourself some coffee, as it will take some time. On an old
401 386SX possibly two weeks. During compilation, you'll get a few
402 warning messages depending in your compiler.
404 If you want to be more selective, you can change into a specific
405 directory and type "make" there.
407 Then you may install the library and its header files under
408 /usr/local/include/wx and /usr/local/lib respectively. You
409 have to log in as root (i.e. run "su" and enter the root
414 You can remove any traces of wxWindows by typing
418 If you want to save disk space by removing unnecessary
423 in the various directories will do the work for you.
425 * Creating a new Project
426 --------------------------
428 1) The first way uses the installed libraries and header files
429 automatically using wx-config
431 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
433 Using this way, a make file for the minimal sample would look
439 $(CXX) -o minimal minimal.o `wx-config --libs`
441 minimal.o: minimal.cpp mondrian.xpm
442 $(CXX) `wx-config --cflags` -c minimal.cpp -o minimal.o
447 This is certain to become the standard way unless we decide
450 2) The other way creates a project within the source code
451 directories of wxWindows. For this endeavour, you'll need
452 GNU autoconf version 2.14 and add an entry to your Makefile.in
453 to the bottom of the configure.in script and run autoconf
454 and configure before you can type make.
456 * Further notes by Julian Smart
457 ---------------------------------
459 - You may find the following script useful for compiling wxMotif,
460 especially if installing from zips (which don't preserve file
461 permissions). Make this script executable with the command
462 chmod a+x makewxmotif.
464 -------:x-----Cut here-----:x-----
466 # Sets permissions (in case we extracted wxMotif from zip files)
468 # Call from top-level wxWindows directory.
469 # Note that this uses standard (but commonly-used) configure options;
470 # if you're feeling brave, you may wish to compile with threads:
471 # if they're not supported by the target platform, they will be disabled
474 chmod a+x configure config.sub config.guess
475 ./configure --with-shared --with-motif --without-gtk --with-debug_flag --with-debug_info --enable-debug --without-threads --without-sockets --without-odbc
477 -------:x-----Cut here-----:x-----
479 This script will build wxMotif using shared libraries. If you want to build
480 a static wxWindows library, use --disable-shared.
485 - Solaris compilation with gcc: if the compiler has problems with the variable argument
486 functions, try putting the gcc fixinclude file paths early in the include
489 - If you operator-related compile errors or strange memory problems
490 (for example in deletion of string arrays), set wxUSE_GLOBAL_MEMORY_OPERATORS
491 and wxUSE_MEMORY_TRACING to 0 in setup.h, and recompile.
493 - If you get an internal compiler error in gcc, turn off optimisations.
495 - Problems with XtDestroyWidget crashing in ~wxWindow have been
496 reported on SGI IRIX 6.4. This has not yet been resolved, so
497 any advice here would be very welcome. See bugs.txt for a
498 possible temporary workaround (comment out the final
499 XtDestroyWidget from ~wxWindow in window.cpp).
501 - Some compilers, such as Sun C++, may give a lot of warnings about
502 virtual functions being hidden. Please ignore these, it's correct C++ syntax.
503 If you find any incorrect instances, though, such as a
504 missing 'const' in an overridden function, please let us know.
509 - Debugging mode is switched on by default in the makefiles, but using
510 configure will create a release build of the library by default: it's
511 recommended to use --with-debug_info and --with-debug_flag configure
512 switches while developing your application. To compile in non-debug
513 mode, remove the -D__WXDEBUG__ switch in make.env (or if using the
514 configure system, change --with-debug_flag to --without_debug_flag
515 and --with-debug_info to --without-debug_info in the makewxmotif
521 Please send bug reports with a description of your environment,
522 compiler and the error message(s) to the wxwin-developers mailing list at:
524 wx-dev@lists.wxwindows.org
526 Julian Smart, Robert Roebling and Vadim Zeitlin, November 1999.