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 On all variants of Unix except Linux (and maybe except *BSD), shared libraries
20 are not supportet out of the box due to the utter stupidity of libtool, so you'll
21 have to do this to get shared library support:
23 > ./configure --with-motif --disable-static --enable-shared
25 Then you'll have to edit the wrongly created libtool script. There are two
26 important entries with respect to shared library creation, which are
28 archive_cmds="\$LD -shared ....
29 archive_expsym_cmds="\$LD -shared ....
31 which should be something like
33 archive_cmds="\$CC -shared ....
34 archive_expsym_cmds="\$CC -shared ....
36 Afterwards you can continue with
39 > su <type root password>
44 If you want to remove wxWindows on Unix you can do this:
46 > su <type root password>
54 If you want to do some more serious cross-platform programming with wxWindows,
55 such as for GTK and Motif, you can now build two complete libraries and use
56 them concurretly. For this end, you have to create a directory for each build
57 of wxWindows - you may also want to create different versions of wxWindows
58 and test them concurrently. Most typically, this would be a version configured
59 with --enable-debug_flag and one without. Note, that only one build can currently
60 be installed, so you'd have to use local version of the library for that purpose.
61 For building three versions (one GTK, one Motif and a debug version of the GTK
62 source) you'd do this:
66 ../configure --with-motif
72 ../configure --with-gtk
78 ../configure --with-gtk --enable-debug_flag
82 * The most simple errors
83 ------------------------
85 You get errors during compilation: The reason is that you probably have a broken
86 compiler, which includes almost everything that is called gcc. If you use gcc 2.8
87 you have to disable optimsation as the compiler will give up with an internal
90 If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
92 You get immediate segfault when starting any sample or application: This is either
93 due to having compiled the library with different flags or options than your program -
94 typically you might have the __WXDEBUG__ option set for the library but not for your
95 program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
97 * The most simple program
98 -------------------------
100 Now create your super-application myfoo.app and compile anywhere with
102 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
105 -----------------------
107 The Unix variants of wxWindows use GNU configure. If you have problems with your
108 make use GNU make instead.
110 If you have general problems with installation, read my homepage at
112 http://wesley.informatik.uni-freiburg.de/~wxxt
114 for newest information. If you still don't have any success, please send a bug
115 report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
116 YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT DISTRIBUTION
117 YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
120 -----------------------
122 wxWindows/Motif requires the Motif library to be installed on your system. As
123 an alternative, you may also use the free library "lesstif" which implements
124 most of the Motif API without the licence restrictions of Motif.
126 You can get the newest version of the Lesstif from the lesstif homepage at:
128 http://www.lesstif.org
130 * Additional libraries
131 -----------------------
133 wxWindows/Motif requires a thread library and X libraries known to work with threads.
134 This is the case on all commercial Unix-Variants and all Linux-Versions that are
135 based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing
136 this, these Linux distributions have correct glibc 2 support:
144 You can disable thread support by running
146 ./configure "--disable-threads"
148 su <type root password>
153 NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE ALL PROGRAMS WILL CRASH UPON
154 START-UP! Just always use egcs and be happy.
156 * Building wxMotif on SGI
157 --------------------------
159 Using the SGI native compilers, it is recommended that you
160 also set CFLAGS and CXXFLAGS before running configure. These
164 CXXFLAGS="-mips3 -n32"
166 This is essential if you want to use the resultant binaries
167 on any other machine than the one it was compiled on. If you
168 have a 64bit machine (Octane) you should also do this to ensure
169 you don't accidently build the libraries as 64bit (which is
172 The SGI native compiler support has only been tested on Irix 6.5.
174 * Create your configuration
175 -----------------------------
180 If you want to use system's C and C++ compiler,
181 set environment variables CC and CCC as
185 % ./configure options
187 to see all the options please use:
191 The basic philosophy is that if you want to use different
192 configurations, like a debug and a release version,
193 or use the same source tree on different systems,
194 you have only to change the environment variable OSTYPE.
195 (Sadly this variable is not set by default on some systems
196 in some shells - on SGI's for example). So you will have to
197 set it there. This variable HAS to be set before starting
198 configure, so that it knows which system it tries to
201 Configure will complain if the system variable OSTYPE has
202 not been defined. And Make in some circumstances as well...
208 Given below are the commands to change the default behaviour,
209 i.e. if it says "--disable-threads" it means that threads
210 are enabled by default.
212 Many of the confiugre options have been thoroughly tested
213 in wxWindows snapshot 6, but not yet all (ODBC not).
215 You have to add --with-motif on platforms, where Motif is
216 not the default (on Linux, configure will deafult to GTK).
218 --without-gtk Don't use the GIMP ToolKit (GTK)
220 --with-motif Use either Motif or Lesstif
221 Configure will look for both.
223 The following options handle the kind of library you want to build.
225 --disable-threads Compile without thread support. Threads
226 support is also required for the
229 --disable-shared Do not create shared libraries.
231 --disable-optimise Do not optimise the code. Can
232 sometimes be useful for debugging
233 and is required on some architectures
234 such as Sun with gcc 2.8.X which
235 would otherwise produce segvs.
237 --enable-profile Add profiling info to the object
238 files. Currently broken, I think.
240 --enable-no_rtti Enable compilation without creation of
241 C++ RTTI information in object files.
242 This will speed-up compilation and reduce
245 --enable-no_exceptions Enable compilation without creation of
246 C++ exception information in object files.
247 This will speed-up compilation and reduce
248 binary size. Also fewer crashes during the
249 actual compilation...
251 --enable-mem_tracing Add built-in memory tracing.
253 --enable-dmalloc Use the dmalloc memory debugger.
254 Read more at www.letters.com/dmalloc/
256 --enable-debug_info Add debug info to object files and
257 executables for use with debuggers
258 such as gdb (or its many frontends).
260 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
261 compiling. This enable wxWindows' very
262 useful internal debugging tricks (such
263 as automatically reporting illegal calls)
264 to work. Note that program and library
265 must be compiled with the same debug
271 Many of the confiugre options have been thoroughly tested
272 in wxWindows snapshot 6, but not yet all (ODBC not).
274 When producing an executable that is linked statically with wxGTK
275 you'll be surprised at its immense size. This can sometimes be
276 drastically reduced by removing features from wxWindows that
277 are not used in your program. The most relevant such features
280 --without-libpng Disables PNG image format code.
282 --without-libjpeg Disables JPEG image format code.
284 { --without-odbc Disables ODBC code. Not yet. }
286 --disable-resources Disables the use of *.wxr type
289 --disable-threads Disables threads. Will also
292 --disable-sockets Disables sockets.
294 --disable-dnd Disables Drag'n'Drop.
296 --disable-clipboard Disables Clipboard.
298 --disable-serial Disables object instance serialiasation.
300 --disable-streams Disables the wxStream classes.
302 --disable-file Disables the wxFile class.
304 --disable-textfile Disables the wxTextFile class.
306 --disable-intl Disables the internationalisation.
308 --disable-validators Disables validators.
310 --disable-accel Disables accel.
312 Apart from disabling certain features you can very often "strip"
313 the program of its debugging information resulting in a significant
319 The following must be done in the base directory (e.g. ~/wxGTK
320 or ~/wxWin or whatever)
322 Now the makefiles are created (by configure) and you can compile
323 the library by typing:
327 make yourself some coffee, as it will take some time. On an old
328 386SX possibly two weeks. During compilation, you'll get a few
329 warning messages depending in your compiler.
331 If you want to be more selective, you can change into a specific
332 directiry and type "make" there.
334 Then you may install the library and it's header files under
335 /usr/local/include/wx and /usr/local/lib respectively. You
336 have to log in as root (i.e. run "su" and enter the root
341 You can remove any traces of wxWindows by typing
345 If you want to save disk space by removing unnecessary
350 in the various directories will do the work for you.
352 * Creating a new Project
353 --------------------------
355 1) The first way uses the installed libraries and header files
356 automatically using wx-config
358 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
360 Using this way, a make file for the minimal sample would look
366 $(CC) -o minimal minimal.o `wx-config --libs`
368 minimal.o: minimal.cpp mondrian.xpm
369 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
374 This is certain to become the standard way unless we decide
377 2) The other way creates a project within the source code
378 directories of wxWindows. For this endeavour, you'll need
379 the usual number of GNU tools, at least
381 GNU automake version 1.4
382 GNU autoheader version 2.14
383 GNU autoconf version 2.14
384 GNU libtool version 1.2 (1.3 seems broken)
391 and if you have all this then you probably know enough to
392 go ahead yourself :-)
394 ----------------------
396 In the hope that it will be useful,
398 Robert Roebling <roebling@sun2.ruf.uni-freiburg.de>