2 !!! When sending bug reports tell us what version of
3 wxWindows you are using (including the beta) and
4 what compiler on what system. One example:
5 wxGTK 2.1 beta 6, egcs 1.1.1, Redhat 5.0 !!!
8 -----------------------
10 If you compile wxWindows on Unix for the first time and don't
11 like to read install instructions just do (in the base dir):
15 su <type root password>
20 If you want to remove wxWindows on Unix you can do this:
22 su <type root password>
30 If you want to do some more serious cross-platform programming
31 with wxWindows, such as for GTK and Motif, you can now build
32 two complete libraries and use them concurretly. For this end,
33 you have to create a directory for each build of wxWindows -
34 you may also want to create different versions of wxWindows
35 and test them concurrently. Most typically, this would be a
36 version configured with --enable-debug_flag and one without.
37 Note, that only one build can currenty be installed, so you'd
38 have to use local version of the library for that purpose.
39 For building three version, one GTK, one Motif and a debug
40 version of the GTK source, you'd do this:
44 ../configure --with-motif
50 ../configure --with-gtk
56 ../configure --with-gtk --enable-debug
60 * The most simple errors
61 ------------------------
63 configure reports, that you don't have GTK 1.X installed
64 although you are certainly sure you have. Well, you have
65 installed it, but you also have another version of the
66 GTK installed, which you may need to removed including
67 other versions of glib (and its headers). Also, look
68 for the PATH variable and check if it includes the path
69 to the correct gtk-config! The check your LDPATH if
70 it points to the correct library. There is no way to
71 compile wxGTK if configure doesn't pass this test as
72 all this test does is compile and link a GTK program.
74 You get errors during compilation: The reason is that you
75 probably have a broken compiler, which includes almost
76 everything that is called gcc. If you use gcc 2.8 you
77 have to disable optimsation as the compiler will give
78 up with an internal compiler error.
80 If there is just any way for you to use egcs, use egcs.
81 We are sorry, but we cannot fix gcc.
83 You get immediate segfault when starting any sample
84 or application: This is either due to having compiled
85 the library with different flags or options than your
86 program - typically you might have the __WXDEBUG__ option
87 set for the library but not for your program - or due
88 to using a broken compiler (and its optimisation) such
91 * The most simple program
92 -------------------------
94 Now create your super-application myfoo.app and compile anywhere
97 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
100 -----------------------
102 The Unix variants of wxWindows use GNU configure. If you have
103 problems with your make use GNU make instead.
105 If you have general problems with installation, read my
108 http://wesley.informatik.uni-freiburg.de/~wxxt
110 for newest information. If you still don't have any success,
111 please send a bug report to one of our mailing lists (see
112 my homepage) INCLUDING A DESCRIPTION OF YOUR SYSTEM AND
113 YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT
114 DISTRIBUTION YOU USE AND WHAT ERROR WAS REPORTED. I know
115 this has no effect, but I tried...
118 -----------------------
120 wxWindows/GTK requires the GTK+ library to be installed on your system.
121 It has to be a stable version, preferebly version 1.2.3. You can use
122 GTK 1.0 in connection with wxWindows, but only without Drag'n'Drop.
123 wxWindows does work with the 1.1.X versions of the GTK+ library.
125 You can get the newest version of the GTK+ from the GTK homepage
129 We also mirror GTK+ 1.2.1 at my ftp site soon. You'll find information
130 about downloading at my homepage.
132 * Additional libraries
133 -----------------------
135 wxWindows/Gtk requires a thread library and X libraries
136 known to work with threads. This is the case on all
137 commercial Unix-Variants and all Linux-Versions that
138 are based on glibc 2 except RedHat 5.0 which is broken
139 in many aspects. As of writing this, these Linux
140 distributions have correct glibc 2 support:
148 You can disable thread support by running
150 ./configure "--disable-threads"
152 su <type root password>
157 NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE
158 ALL PROGRAMS WILL CRASH UPON START-UP! Just always
159 use egcs and be happy.
161 * Create your configuration
162 -----------------------------
167 If you want to use system's C and C++ compiler,
168 set environment variables CC and CCC as
172 % ./configure options
174 Using the SGI native compilers, it is recommended that you
175 also set CFLAGS and CXXFLAGS before running configure. These
179 CXXFLAGS="-mips3 -n32"
181 This is essential if you want to use the resultant binaries
182 on any other machine than the one it was compiled on. If you
183 have a 64bit machine (Octane) you should also do this to ensure
184 you don't accidently build the libraries as 64bit (which is
187 The SGI native compiler support has only been tested on Irix 6.5.
189 to see all the options please use:
193 The basic philosophy is that if you want to use different
194 configurations, like a debug and a release version,
195 or use the same source tree on different systems,
196 you have only to change the environment variable OSTYPE.
197 (Sadly this variable is not set by default on some systems
198 in some shells - on SGI's for example). So you will have to
199 set it there. This variable HAS to be set before starting
200 configure, so that it knows which system it tries to
203 Configure will complain if the system variable OSTYPE has
204 not been defined. And Make in some circumstances as well...
210 The confiugre options have not yet been thoroughly tested
211 in wxWindows snapshot 6.
213 Normally, you won't have to choose a toolkit, because when
214 you download wxGTK, it will default to --with-gtk etc. But
215 if you use all of our CVS repository you have to choose a
216 toolkit. You must do this by running configure with either of:
218 --with-gtk 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-mem_tracing Add built-in memory tracing.
242 --enable-dmalloc Use the dmalloc memory debugger.
243 Read more at www.letters.com/dmalloc/
245 --enable-debug_info Add debug info to object files and
246 executables for use with debuggers
247 such as gdb (or its many frontends).
249 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
250 compiling. This enable wxWindows' very
251 useful internal debugging tricks (such
252 as automatically reporting illegal calls)
253 to work. Note that program and library
254 must be compiled with the same debug
260 The confiugre options have not yet been thoroughly tested
261 in wxWindows snapshot 6.
263 When producing an executable that is linked statically with wxGTK
264 you'll be surprised at its immense size. This can sometimes be
265 drastically reduced by removing features from wxWindows that
266 are not used in your program. The most relevant such features
269 --without-libpng Disables PNG image format code.
271 --without-libjpeg Disables JPEG image format code.
273 --without-odbc Disables ODBC code.
275 --disable-wxresources Disables the use of *.wxr type
278 --disable-threads Disables threads. Will also
281 --disable-sockets Disables sockets.
283 --disable-dnd Disables Drag'n'Drop.
285 --disable-clipboard Disables Clipboard.
287 --disable-serial Disables object instance serialiasation.
289 --disable-streams Disables the wxStream classes.
291 Apart from disabling certain features you can very often "strip"
292 the program of its debugging information resulting in a significant
298 The following must be done in the base directory (e.g. ~/wxGTK
299 or ~/wxWin or whatever)
301 Now the makefiles are created (by configure) and you can compile
302 the library by typing:
306 make yourself some coffee, as it will take some time. On an old
307 386SX possibly two weeks. During compilation, you'll get a few
308 warning messages depending in your compiler.
310 if you want to be more selective, you can change into a specific
311 directiry and type "make" there.
313 Then you may install the library and it's header files under
314 /usr/local/include/wx and /usr/local/lib respectively. You
315 have to log in as root (i.e. run "su" and enter the root
320 You can remove any traces of wxWindows by typing
324 If you want to save disk space by removing unnecessary
329 in the various directories will do the work for you.
331 * Creating a new Project
332 --------------------------
334 There are two ways to create your own project:
336 1) The first way uses the installed libraries and header files
337 automatically using wx-config
339 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
341 Using this way, a make file for the minimal sample would look
347 $(CC) -o minimal minimal.o `wx-config --libs`
349 minimal.o: minimal.cpp mondrian.xpm
350 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
355 This is certain to become the standard way unless we decide
358 2) The other way creates a project within the source code
359 directories of wxWindows. For this endeavour, you'll need
360 the usual number of GNU tools, at least
362 GNU automake version 1.4
363 GNU autoheader version 2.14
364 GNU autoconf version 2.14
371 and if you have all this then you probably know enough to
372 go ahead yourself :-)
374 ** Something about Makefiles
375 ------------------------------
377 On general principle it should only contain ONE line, which is as follows:
379 include ../../setup/general/makeapp
381 this will include all the necessary definitions for creating the applications
383 the only case where you might want to add another line is the following:
384 this version of configure also supports creation of source archives of the
385 application for easy distribution and updates to newer version of wxWindows.
386 For this purpose all files in the application-directory will be put into
387 a gziped tar-file in the full notation user/<your application>/*
388 if you want to include some other files that you want "more visible", like
389 a README.<yourApp> or a shell script for easy
390 compilation/installation/distribution, then you have to add a variable
392 DISTRIBUTE_ADDITIONAL=<your files>
395 So it would look like this:
397 DISTRIBUTE_ADDITIONAL=README.TheApp
398 include ../../setup/general/makeapp
400 As we have already talked about distribution the command to create a
405 NOTE: If you are in the base directory of wxWindows it will create
406 distribution packages for wxWindows as well as for all packages in the
408 So if you want to create only packages for the files in user,
409 then go to the directory other and type:
413 or if you only want one application to be created then
414 enter the specific directory and type there:
417 All the distribution files will be put in the directory
418 distrib at the base of the wxWindows-tree (where also configure
419 and template.mak can be found).
421 ** Something about Makefile.in
422 --------------------------------
424 As you have already seen with Makefile, configure makes a lot of use
425 if the include statement in make to keep the Makefiles as simple as
428 So basically there are only variables to define and then a include command.
429 Exception to this rule is if you have special rules for some stuff...
430 These rules should go AFTER the include statement!!!
432 so the general header looks like this:
434 # wxWindows base directory
435 WXBASEDIR=@WXBASEDIR@
436 # set the OS type for compilation
438 # compile a library only
441 and the general footer will look like this:
443 # include the definitions now
444 include ../../../template.mak
446 the key variable is RULE, which defines what make should create
449 here are some examples:
452 ===========================================================================
453 bin creates a local binary (for a global binary prefix bin with g)
454 additional variables needed:
455 BIN_TARGET this gives the name of your application
456 BIN_OBJ this gives the object files needed to
458 optional variables are:
459 BIN_SRC this gives the list of c/c++ files for
460 which dependencies will be checked.
461 (This can be achieved with: make depend)
462 BIN_LINK this gives commands for additional
463 libraries needed to link the application
464 ---------------------------------------------------------------------------
465 bin2 creates two local binaries (for global binaries prefix bin2 with g)
466 in addition to the variables specified above you MUST also
467 provide the same variables with BIN2_ instead of BIN_
468 ---------------------------------------------------------------------------
469 lib creates a local library (for a global binary prefix bin with g)
470 additional variables needed:
471 LIB_TARGET this gives the name of your library
472 LIB_OBJ this gives the object files needed for
473 the library to be build.
474 optional variables are:
475 LIB_SRC this gives the list of c/c++ files for
476 which dependencies will be checked.
477 libbin and libgbin are also possible and will need in addition
478 the variables from bin
479 ---------------------------------------------------------------------------
480 gslib is similar to lib, but it creates a shared library if the system
482 additional variables needed:
483 LIB_MAJOR major number of the shared library
484 LIB_MINOR minor number of the shared library
485 ---------------------------------------------------------------------------
486 other additional variables:
488 ADD_COMPILE define additional includes/defines that
489 are needed to compile the object files
490 (if you need to reference some directory
491 utils - like wxGrid -, then please
492 reference them with the variables defined
493 in template.mak - e.g.: $(SRCDIR),$(UTILS),
494 $(SAMPLES),$(OTHERS))
496 NEEDED_DEFINES lists all the defines that HAVE to be set in
497 /include/wx/setup.h to compile correctly.
499 SRC_DIR lists all directories that are needed to
500 compile. (i.e: lists all the directories,
501 where there are source-files.) But it is
502 also needed to clean an object and for
503 machines, for which make does not support
506 currently there are the following compiling rules provided:
507 object files are created for the following file extensions:
510 Please have a closer look at the Makefiles in this distribution.
512 * Platforms configure is working with
513 ---------------------------------------
515 Please report build succes on any machine. Especially non-
516 Linux operating systems (which I don't have).
518 Original author of the autoconf system for wxxt-1.66 and for this INSTALL
521 Martin Sperl sperl@dsn.ast.univie.ac.at
525 Wolfram Gloger wmglo@dent.med.uni-muenchen.de
527 Thanks alot to both of them.
529 In the hope that it will be useful,
531 Robert Roebling roebling@sun2.ruf.uni-freiburg.de