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 Unix 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 other Unices (maybe except *BSD), shared libraries are not supported
20 out of the box due to the utter stupidity of libtool, so you'll have to do
23 ./configure --enable-static --disable-shared
25 su <type root password>
30 You may also want to try to edit the wrongly created libtool script
31 in your build directory, if you need shared libraries on Unix. The
32 wrong entries are something like
33 archive_cmds="\$LD -shared ....
34 archive_expsym_cmds="\$LD -shared ....
35 which should be something like
36 archive_cmds="\$CC -shared ....
37 archive_expsym_cmds="\$CC -shared ....
39 If you want to remove wxWindows on Unix you can do this:
41 su <type root password>
49 If you want to do some more serious cross-platform programming with wxWindows,
50 such as for GTK and Motif, you can now build two complete libraries and use
51 them concurretly. For this end, you have to create a directory for each build
52 of wxWindows - you may also want to create different versions of wxWindows
53 and test them concurrently. Most typically, this would be a version configured
54 with --enable-debug_flag and one without. Note, that only one build can currently
55 be installed, so you'd have to use local version of the library for that purpose.
56 For building three versions (one GTK, one Motif and a debug version of the GTK
57 source) you'd do this:
61 ../configure --with-motif
67 ../configure --with-gtk
73 ../configure --with-gtk --enable-debug_flag
77 * The most simple errors
78 ------------------------
80 You get errors during compilation: The reason is that you probably have a broken
81 compiler, which includes almost everything that is called gcc. If you use gcc 2.8
82 you have to disable optimsation as the compiler will give up with an internal
85 If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
87 You get immediate segfault when starting any sample or application: This is either
88 due to having compiled the library with different flags or options than your program -
89 typically you might have the __WXDEBUG__ option set for the library but not for your
90 program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
92 * The most simple program
93 -------------------------
95 Now create your super-application myfoo.app and compile anywhere with
97 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
100 -----------------------
102 The Unix variants of wxWindows use GNU configure. If you have problems with your
103 make use GNU make instead.
105 If you have general problems with installation, read my homepage at
107 http://wesley.informatik.uni-freiburg.de/~wxxt
109 for newest information. If you still don't have any success, please send a bug
110 report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
111 YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT DISTRIBUTION
112 YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
115 -----------------------
117 wxWindows/Motif requires the Motif library to be installed on your system. As
118 an alternative, you may also use the free library "lesstif" which implements
119 most of the Motif API without the licence restrictions of Motif.
121 You can get the newest version of the Lesstif from the lesstif homepage at:
123 http://www.lesstif.org
125 * Additional libraries
126 -----------------------
128 wxWindows/Motif requires a thread library and X libraries known to work with threads.
129 This is the case on all commercial Unix-Variants and all Linux-Versions that are
130 based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing
131 this, these Linux distributions have correct glibc 2 support:
139 You can disable thread support by running
141 ./configure "--disable-threads"
143 su <type root password>
148 NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE ALL PROGRAMS WILL CRASH UPON
149 START-UP! Just always use egcs and be happy.
151 * Building wxMotif on SGI
152 --------------------------
154 Using the SGI native compilers, it is recommended that you
155 also set CFLAGS and CXXFLAGS before running configure. These
159 CXXFLAGS="-mips3 -n32"
161 This is essential if you want to use the resultant binaries
162 on any other machine than the one it was compiled on. If you
163 have a 64bit machine (Octane) you should also do this to ensure
164 you don't accidently build the libraries as 64bit (which is
167 The SGI native compiler support has only been tested on Irix 6.5.
169 * Create your configuration
170 -----------------------------
175 If you want to use system's C and C++ compiler,
176 set environment variables CC and CCC as
180 % ./configure options
182 to see all the options please use:
186 The basic philosophy is that if you want to use different
187 configurations, like a debug and a release version,
188 or use the same source tree on different systems,
189 you have only to change the environment variable OSTYPE.
190 (Sadly this variable is not set by default on some systems
191 in some shells - on SGI's for example). So you will have to
192 set it there. This variable HAS to be set before starting
193 configure, so that it knows which system it tries to
196 Configure will complain if the system variable OSTYPE has
197 not been defined. And Make in some circumstances as well...
203 Given below are the commands to change the default behaviour,
204 i.e. if it says "--disable-threads" it means that threads
205 are enabled by default.
207 Many of the confiugre options have been thoroughly tested
208 in wxWindows snapshot 6, but not yet all (ODBC not).
210 You have to add --with-motif on platforms, where Motif is
211 not the default (on Linux, configure will deafult to GTK).
213 --without-gtk Don't use the GIMP ToolKit (GTK)
215 --with-motif Use either Motif or Lesstif
216 Configure will look for both.
218 The following options handle the kind of library you want to build.
220 --disable-threads Compile without thread support. Threads
221 support is also required for the
224 --disable-shared Do not create shared libraries.
226 --disable-optimise Do not optimise the code. Can
227 sometimes be useful for debugging
228 and is required on some architectures
229 such as Sun with gcc 2.8.X which
230 would otherwise produce segvs.
232 --enable-profile Add profiling info to the object
233 files. Currently broken, I think.
235 --enable-no_rtti Enable compilation without creation of
236 C++ RTTI information in object files.
237 This will speed-up compilation and reduce
240 --enable-no_exceptions Enable compilation without creation of
241 C++ exception information in object files.
242 This will speed-up compilation and reduce
243 binary size. Also fewer crashes during the
244 actual compilation...
246 --enable-mem_tracing Add built-in memory tracing.
248 --enable-dmalloc Use the dmalloc memory debugger.
249 Read more at www.letters.com/dmalloc/
251 --enable-debug_info Add debug info to object files and
252 executables for use with debuggers
253 such as gdb (or its many frontends).
255 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
256 compiling. This enable wxWindows' very
257 useful internal debugging tricks (such
258 as automatically reporting illegal calls)
259 to work. Note that program and library
260 must be compiled with the same debug
266 Many of the confiugre options have been thoroughly tested
267 in wxWindows snapshot 6, but not yet all (ODBC not).
269 When producing an executable that is linked statically with wxGTK
270 you'll be surprised at its immense size. This can sometimes be
271 drastically reduced by removing features from wxWindows that
272 are not used in your program. The most relevant such features
275 --without-libpng Disables PNG image format code.
277 --without-libjpeg Disables JPEG image format code.
279 { --without-odbc Disables ODBC code. Not yet. }
281 --disable-resources Disables the use of *.wxr type
284 --disable-threads Disables threads. Will also
287 --disable-sockets Disables sockets.
289 --disable-dnd Disables Drag'n'Drop.
291 --disable-clipboard Disables Clipboard.
293 --disable-serial Disables object instance serialiasation.
295 --disable-streams Disables the wxStream classes.
297 --disable-file Disables the wxFile class.
299 --disable-textfile Disables the wxTextFile class.
301 --disable-intl Disables the internationalisation.
303 --disable-validators Disables validators.
305 --disable-accel Disables accel.
307 Apart from disabling certain features you can very often "strip"
308 the program of its debugging information resulting in a significant
314 The following must be done in the base directory (e.g. ~/wxGTK
315 or ~/wxWin or whatever)
317 Now the makefiles are created (by configure) and you can compile
318 the library by typing:
322 make yourself some coffee, as it will take some time. On an old
323 386SX possibly two weeks. During compilation, you'll get a few
324 warning messages depending in your compiler.
326 If you want to be more selective, you can change into a specific
327 directiry and type "make" there.
329 Then you may install the library and it's header files under
330 /usr/local/include/wx and /usr/local/lib respectively. You
331 have to log in as root (i.e. run "su" and enter the root
336 You can remove any traces of wxWindows by typing
340 If you want to save disk space by removing unnecessary
345 in the various directories will do the work for you.
347 * Creating a new Project
348 --------------------------
350 1) The first way uses the installed libraries and header files
351 automatically using wx-config
353 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
355 Using this way, a make file for the minimal sample would look
361 $(CC) -o minimal minimal.o `wx-config --libs`
363 minimal.o: minimal.cpp mondrian.xpm
364 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
369 This is certain to become the standard way unless we decide
372 2) The other way creates a project within the source code
373 directories of wxWindows. For this endeavour, you'll need
374 the usual number of GNU tools, at least
376 GNU automake version 1.4
377 GNU autoheader version 2.14
378 GNU autoconf version 2.14
379 GNU libtool version 1.2 (1.3 seems broken)
386 and if you have all this then you probably know enough to
387 go ahead yourself :-)
389 ----------------------
391 In the hope that it will be useful,
393 Robert Roebling <roebling@sun2.ruf.uni-freiburg.de>