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>
27 * The most simple errors
28 ------------------------
30 configure reports, that you don't have GTK 1.X installed
31 although you are certainly sure you have. Well, you have
32 installed it, but you also have another version of the
33 GTK installed, which you may need to removed including
34 other versions of glib (and its headers). Also, look
35 for the PATH variable and check if it includes the path
36 to the correct gtk-config! The check your LDPATH if
37 it points to the correct library. There is no way to
38 compile wxGTK if configure doesn't pass this test as
39 all this test does is compile and link a GTK program.
41 You get errors during compilation: The reason is that you
42 probably have a broken compiler, which includes almost
43 everything that is called gcc. If you use gcc 2.8 you
44 have to disable optimsation as the compiler will give
45 up with an internal compiler error.
47 If there is just any way for you to use egcs, use egcs.
48 We are sorry, but we cannot fix gcc.
50 You get immediate segfault when starting any sample
51 or application: This is _always_ due to having compiled
52 the library with different flags or options than your
53 program. Typically you might have the __WXDEBUG__ option
54 set for the library but not for your program.
56 * The most simple program
57 -------------------------
59 Now create your super-application myfoo.app and compile anywhere
62 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
65 -----------------------
67 The Unix variants of wxWindows use GNU configure. If you have
68 problems with your make use GNU make instead.
70 If you have general problems with installation, read my
73 http://wesley.informatik.uni-freiburg.de/~wxxt
75 for newest information. If you still don't have any success,
76 please send a bug report to one of our mailing lists (see
77 my homepage) INCLUDING A DESCRIPTION OF YOUR SYSTEM AND
78 YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT
79 DISTRIBUTION YOU USE AND WHAT ERROR WAS REPORTED. I know
80 this has no effect, but I tried...
83 -----------------------
85 wxWindows/GTK requires the GTK+ library to be installed on your system.
86 It has to be a stable version, preferebly version 1.2.3. You can use
87 GTK 1.0 in connection with wxWindows, but only without Drag'n'Drop.
88 wxWindows does work with the 1.1.X versions of the GTK+ library.
90 You can get the newest version of the GTK+ from the GTK homepage
94 We also mirror GTK+ 1.2.1 at my ftp site soon. You'll find information
95 about downloading at my homepage.
97 * Additional libraries
98 -----------------------
100 wxWindows/Gtk requires a thread library and X libraries
101 known to work with threads. This is the case on all
102 commercial Unix-Variants and all Linux-Versions that
103 are based on glibc 2 except RedHat 5.0 which is broken
104 in many aspects. As of writing this, these Linux
105 distributions have correct glibc 2 support:
113 You can disable thread support by running
115 ./configure "--disable-threads"
117 su <type root password>
122 NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE
123 ALL PROGRAMS WILL CRASH UPON START-UP! Just always
124 use egcs and be happy.
126 * Create your configuration
127 -----------------------------
132 If you want to use system's C and C++ compiler,
133 set environment variables CC and CCC as
137 % ./configure options
139 Using the SGI native compilers, it is recommended that you
140 also set CFLAGS and CXXFLAGS before running configure. These
144 CXXFLAGS="-mips3 -n32"
146 This is essential if you want to use the resultant binaries
147 on any other machine than the one it was compiled on. If you
148 have a 64bit machine (Octane) you should also do this to ensure
149 you don't accidently build the libraries as 64bit (which is
152 The SGI native compiler support has only been tested on Irix 6.5.
154 to see all the options please use:
158 The basic philosophy is that if you want to use different
159 configurations, like a debug and a release version,
160 or use the same source tree on different systems,
161 you have only to change the environment variable OSTYPE.
162 (Sadly this variable is not set by default on some systems
163 in some shells - on SGI's for example). So you will have to
164 set it there. This variable HAS to be set before starting
165 configure, so that it knows which system it tries to
168 Configure will complain if the system variable OSTYPE has
169 not been defined. And Make in some circumstances as well...
177 Normally, you won't have to choose a toolkit, because when
178 you download wxGTK, it will default to --with-gtk etc. But
179 if you use all of our CVS repository you have to choose a
180 toolkit. You must do this by running configure with either of:
182 --with-gtk Use the GIMP ToolKit (GTK)
184 --with-motif Use either Motif or Lesstif
185 Configure will look for both.
187 The following options handle the kind of library you want to build.
189 --with-threads Compile with thread support. Threads
190 support is also required for the
193 --without-shared Do not create shared libraries.
195 --without-optimise Do not optimise the code. Can
196 sometimes be useful for debugging
197 and is required on some architectures
198 such as Sun with gcc 2.8.X which
199 would otherwise produce segvs.
201 --with-profile Add profiling info to the object
202 files. Currently broken, I think.
204 --with-mem_tracing Add built-in memory tracing.
206 --with-dmalloc Use the dmalloc memory debugger.
207 Read more at www.letters.com/dmalloc/
209 --with-debug_info Add debug info to object files and
210 executables for use with debuggers
211 such as gdb (or its many frontends).
213 --with-debug_flag Define __DEBUG__ and __WXDEBUG__ when
214 compiling. This enable wxWindows' very
215 useful internal debugging tricks (such
216 as automatically reporting illegal calls)
217 to work. Note that program and library
218 must be compiled with the same debug
226 When producing an executable that is linked statically with wxGTK
227 you'll be surprised at its immense size. This can sometimes be
228 drastically reduced by removing features from wxWindows that
229 are not used in your program. The most relevant such features
232 --without-libpng Disables PNG image format code.
234 --without-libjpeg Disables JPEG image format code.
236 --without-odbc Disables ODBC code.
238 --without-wxresources Disables the use of *.wxr type
241 --without-threads Disables threads. Will also
244 --without-sockets Disables sockets.
246 --without-dnd Disables Drag'n'Drop.
248 --without-clipboard Disables Clipboard.
250 --without-serial Disables object instance serialiasation.
252 --without-streams Disables the wxStream classes.
254 Apart from disabling certain features you can very often "strip"
255 the program of its debugging information resulting in a significant
261 The following must be done in the base directory (e.g. ~/wxGTK
262 or ~/wxWin or whatever)
264 Now the makefiles are created (by configure) and you can compile
265 the library by typing:
269 make yourself some coffee, as it will take some time. On an old
270 386SX possibly week. During compilation, you'll get a few
271 warning messages depending in your compiler.
273 if you want to be more selective, you can change into a specific
274 directiry and type "make" there.
276 Then you may install the library and it's header files under
277 /usr/local/include/wx and /usr/local/lib respectively. You
278 have to log in as root (i.e. run "su" and enter the root
283 You can remove any traces of wxWindows by typing
287 If you want to save disk space by removing unnecessary
292 in the various directories will do the work for you.
294 * Creating a new Project
295 --------------------------
297 There are two ways to create your own project:
299 1) The first way uses the installed libraries and header files
300 automatically using wx-config
302 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
304 Using this way, a make file for the minimal sample would look
310 $(CC) -o minimal minimal.o `wx-config --libs`
312 minimal.o: minimal.cpp mondrian.xpm
313 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
318 This is certain to become the standard way unless we decide
321 2) The other way creates a project within the source code
322 directories of wxWindows. For this endeavour, you'll need
323 the usual number of GNU tools, at least
325 GNU automake version 1.4
326 GNU autoheader version 2.14
327 GNU autoconf version 2.14
334 and if you have all this then you probably know enough to
335 go ahead yourself :-)
337 ** Something about Makefiles
338 ------------------------------
340 On general principle it should only contain ONE line, which is as follows:
342 include ../../setup/general/makeapp
344 this will include all the necessary definitions for creating the applications
346 the only case where you might want to add another line is the following:
347 this version of configure also supports creation of source archives of the
348 application for easy distribution and updates to newer version of wxWindows.
349 For this purpose all files in the application-directory will be put into
350 a gziped tar-file in the full notation user/<your application>/*
351 if you want to include some other files that you want "more visible", like
352 a README.<yourApp> or a shell script for easy
353 compilation/installation/distribution, then you have to add a variable
355 DISTRIBUTE_ADDITIONAL=<your files>
358 So it would look like this:
360 DISTRIBUTE_ADDITIONAL=README.TheApp
361 include ../../setup/general/makeapp
363 As we have already talked about distribution the command to create a
368 NOTE: If you are in the base directory of wxWindows it will create
369 distribution packages for wxWindows as well as for all packages in the
371 So if you want to create only packages for the files in user,
372 then go to the directory other and type:
376 or if you only want one application to be created then
377 enter the specific directory and type there:
380 All the distribution files will be put in the directory
381 distrib at the base of the wxWindows-tree (where also configure
382 and template.mak can be found).
384 ** Something about Makefile.in
385 --------------------------------
387 As you have already seen with Makefile, configure makes a lot of use
388 if the include statement in make to keep the Makefiles as simple as
391 So basically there are only variables to define and then a include command.
392 Exception to this rule is if you have special rules for some stuff...
393 These rules should go AFTER the include statement!!!
395 so the general header looks like this:
397 # wxWindows base directory
398 WXBASEDIR=@WXBASEDIR@
399 # set the OS type for compilation
401 # compile a library only
404 and the general footer will look like this:
406 # include the definitions now
407 include ../../../template.mak
409 the key variable is RULE, which defines what make should create
412 here are some examples:
415 ===========================================================================
416 bin creates a local binary (for a global binary prefix bin with g)
417 additional variables needed:
418 BIN_TARGET this gives the name of your application
419 BIN_OBJ this gives the object files needed to
421 optional variables are:
422 BIN_SRC this gives the list of c/c++ files for
423 which dependencies will be checked.
424 (This can be achieved with: make depend)
425 BIN_LINK this gives commands for additional
426 libraries needed to link the application
427 ---------------------------------------------------------------------------
428 bin2 creates two local binaries (for global binaries prefix bin2 with g)
429 in addition to the variables specified above you MUST also
430 provide the same variables with BIN2_ instead of BIN_
431 ---------------------------------------------------------------------------
432 lib creates a local library (for a global binary prefix bin with g)
433 additional variables needed:
434 LIB_TARGET this gives the name of your library
435 LIB_OBJ this gives the object files needed for
436 the library to be build.
437 optional variables are:
438 LIB_SRC this gives the list of c/c++ files for
439 which dependencies will be checked.
440 libbin and libgbin are also possible and will need in addition
441 the variables from bin
442 ---------------------------------------------------------------------------
443 gslib is similar to lib, but it creates a shared library if the system
445 additional variables needed:
446 LIB_MAJOR major number of the shared library
447 LIB_MINOR minor number of the shared library
448 ---------------------------------------------------------------------------
449 other additional variables:
451 ADD_COMPILE define additional includes/defines that
452 are needed to compile the object files
453 (if you need to reference some directory
454 utils - like wxGrid -, then please
455 reference them with the variables defined
456 in template.mak - e.g.: $(SRCDIR),$(UTILS),
457 $(SAMPLES),$(OTHERS))
459 NEEDED_DEFINES lists all the defines that HAVE to be set in
460 /include/wx/setup.h to compile correctly.
462 SRC_DIR lists all directories that are needed to
463 compile. (i.e: lists all the directories,
464 where there are source-files.) But it is
465 also needed to clean an object and for
466 machines, for which make does not support
469 currently there are the following compiling rules provided:
470 object files are created for the following file extensions:
473 Please have a closer look at the Makefiles in this distribution.
475 * Platforms configure is working with
476 ---------------------------------------
478 Please report build succes on any machine. Especially non-
479 Linux operating systems (which I don't have).
481 Original author of the autoconf system for wxxt-1.66 and for this INSTALL
484 Martin Sperl sperl@dsn.ast.univie.ac.at
488 Wolfram Gloger wmglo@dent.med.uni-muenchen.de
490 Thanks alot to both of them.
492 In the hope that it will be useful,
494 Robert Roebling roebling@sun2.ruf.uni-freiburg.de