1 \chapter{Installing wxWindows
}\label{chapinstall
}
2 \pagenumbering{arabic
}%
3 \setheader{{\it CHAPTER
\thechapter: INSTALLING wxWINDOWS
}}{}{}{}{}{{\it CHAPTER
\thechapter: INSTALLING wxWINDOWS
}}%
4 \setfooter{\thepage}{}{}{}{}{\thepage}%
6 CONTENTS: Installing wxWindows (and what tools to use).
8 Installing wxWindows isn't too hard. Each platform has a different method, so we'll look
9 at each major platform in turn.
11 \section{Unix: GTK+ and Motif
}\label{installunix
}
13 \subsection{The simplest case
}
15 If you are compile wxWindows on Linux for the first time and don't like to read
16 install instructions, just do this in the base directory:
19 ./configure --with-gtk
21 su <type root password>
27 This is using the GTK+ port. If using the Motif port, type --with-motif instead of --with-gtk.
29 Afterwards you can continue with:
33 su <type root password>
39 If you want to remove wxWindows on Unix you can do this:
42 su <type root password>
48 \subsection{The expert case
}
50 If you want to do some more serious cross-platform programming with wxWindows,
51 such as for GTK and Motif, you can now build two complete libraries and use
52 them concurrently. For this end, you have to create a directory for each build
53 of wxWindows - you may also want to create different versions of wxWindows
54 and test them concurrently. Most typically, this would be a version configured
55 with --enable-debug
\_flag and one without. Note, that only one build can currently
56 be installed, so you'd have to use a local version of the library for that purpose.
57 For building three versions (one for GTK+, one for Motif and a debug GTK+ version) you'd do this:
62 ../configure --with-motif
68 ../configure --with-gtk
74 ../configure --with-gtk --enable-debug_flag
79 \subsection{The simplest errors
}
81 \begin{itemize
}\itemsep=
0pt
82 \item Configure reports, that you don't have GTK
1.2 installed although you are
83 very sure you have. Well, you have installed it, but you also have another
84 version of the GTK installed, which you may need to remove including other
85 versions of glib (and its headers). Also, look for the PATH variable and check
86 if it includes the path to the correct gtk-config! The check your LDPATH if it
87 points to the correct library. There is no way to compile wxGTK if configure
88 doesn't pass this test as all this test does is compile and link a GTK program.
89 \item You get errors during compilation: The reason is that you probably have a
90 broken compiler. GCC
2.8 and earlier versions and egcs are likely to cause
91 problems due to incomplete support for C++ and optimisation bugs. Best to use
93 \item You get immediate segfault when starting any sample or application: This is
94 either due to having compiled the library with different flags or options than
95 your program - typically you might have the
\_\_WXDEBUG\_\_ option set for the
96 library but not for your program - or due to using a compiler with optimisation
100 \subsection{The simplest program
}
102 Now create your super-application myfoo.app and compile anywhere with:
105 g++ myfoo.cpp `wx-config --libs --cxxflags` -o myfoo
110 The Unix variants of wxWindows use GNU configure. If you have problems with your
111 make use GNU make instead.
113 If you have general problems with installation, visit Robert Roebling's homepage at
116 http://wesley.informatik.uni-freiburg.de/~wxxt
119 for the latest information. If you still don't have any success, please send a bug
120 report to one of the mailing lists.
122 \wxheading{Libraries needed
}
124 wxWindows/GTK requires the GTK+ library to be installed on your system. It has to
125 be a stable version, preferably version
1.2.3.
127 You can get the newest version of the GTK+ from the GTK homepage at:
133 wxWindows/Gtk 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:
138 \begin{itemize
}\itemsep=
0pt
140 \item Debian
2.0 and
3.0
146 You can disable thread support by running
149 ./configure --disable-threads
151 su <type root password>
157 \subsection{Building wxGTK on OS/
2}
159 Please send comments and question about the OS/
2 installation
160 to Andrea Venturoli <a.ventu@flashnet.it> and patches to
161 the wxWindows mailing list.
163 You'll need OS/
2 Warp (
4.00FP
#6), X-Free86/
2 (
3.3.3 or newer),
164 GTK+ (
1.2.5 or newer), emx (
0.9d fix
1), flex (
2.5.4), yacc (
1.8),
165 korn shell (
5.2.13), Autoconf (
2.13), GNU file utilities (
3.6),
166 GNU text utilities (
1.3), GNU shell utilites (
1.12), m4 (
1.4),
167 sed (
2.05), grep (
2.0), Awk (
3.0.3), GNU Make (
3.76.1).
169 Open an OS/
2 prompt and switch to the directory above.
170 First set some global environment variables we need:
173 SET CXXFLAGS=-Zmtd -D__ST_MT_ERRNO__
174 SET CFLAGS=-Zmtd -D__ST_MT_ERRNO__
179 Notice you can choose whatever you want, if you don't like OS2X.
181 Now, run autoconf in the main directory and in the samples, demos
182 and utils subdirectory. This will generate the OS/
2 specific
183 versions of the configure scripts. Now run
191 If you have pthreads library installed, but have a gtk version
192 which does not yet support threading, you need to explicitly
193 disable threading by using the option --disable-threads.
195 Note that configure assumes your flex will generate files named
196 "lexyy.c", not "lex.yy.c". If you have a version which does
197 generate "lex.yy.c", you need to manually change the generated
200 \subsection{Building wxGTK on SGI
}
202 Using the SGI native compilers, it is recommended that you
203 also set CFLAGS and CXXFLAGS before running configure. These
208 CXXFLAGS="-mips3 -n32"
211 This is essential if you want to use the resultant binaries
212 on any other machine than the one it was compiled on. If you
213 have a
64-bit machine (Octane) you should also do this to ensure
214 you don't accidently build the libraries as
64bit (which is
217 The SGI native compiler support has only been tested on Irix
6.5.
219 \subsection{Create your configuration
}
227 If you want to use system's C and C++ compiler,
228 set environment variables CC and CCC as
236 to see all the options please use:
242 The basic philosophy is that if you want to use different
243 configurations, like a debug and a release version,
244 or use the same source tree on different systems,
245 you have only to change the environment variable OSTYPE.
246 (Sadly this variable is not set by default on some systems
247 in some shells - on SGI's for example). So you will have to
248 set it there. This variable HAS to be set before starting
249 configure, so that it knows which system it tries to
252 Configure (and sometimes make) will complain if the system variable OSTYPE has
255 \subsubsection{General options
}
257 Given below are the commands to change the default behaviour,
258 i.e. if it says "--disable-threads" it means that threads
259 are enabled by default.
261 Normally, you won't have to choose a toolkit, because when
262 you download wxGTK, it will default to --with-gtk etc. But
263 if you use all of our CVS repository you have to choose a
264 toolkit. You must do this by running configure with either of:
267 --without-gtk Don't use the GIMP ToolKit (GTK)
269 --with-motif Use either Motif or Lesstif
270 Configure will look for both.
273 The following options handle the kind of library you want to build.
276 --disable-threads Compile without thread support.
278 --disable-shared Do not create shared libraries.
280 --enable-static Create static libraries.
282 --disable-optimise Do not optimise the code. Can
283 sometimes be useful for debugging
284 and is required on some architectures
285 such as Sun with gcc
2.8.X which
286 and otherwise produce segvs.
288 --enable-profile Add profiling info to the object
289 files. Currently broken, I think.
291 --enable-no_rtti Enable compilation without creation of
292 C++ RTTI information in object files.
293 This will speed-up compilation and reduce
296 --enable-no_exceptions Enable compilation without creation of
297 C++ exception information in object files.
298 This will speed-up compilation and reduce
299 binary size. Also fewer crashes during the
300 actual compilation...
302 --enable-no_deps Enable compilation without creation of
303 dependency information.
305 --enable-permissive Enable compilation without checking for strict
306 ANSI conformance. Useful to prevent the build
307 dying with errors as soon as you compile with
308 Solaris' ANSI-defying headers.
310 --enable-mem_tracing Add built-in memory tracing.
312 --enable-dmalloc Use the dmalloc memory debugger.
313 Read more at www.letters.com/dmalloc/
315 --enable-debug_info Add debug info to object files and
316 executables for use with debuggers
317 such as gdb (or its many frontends).
319 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
320 compiling. This enable wxWindows' very
321 useful internal debugging tricks (such
322 as automatically reporting illegal calls)
323 to work. Note that program and library
324 must be compiled with the same debug
328 \subsubsection{Feature Options
}
330 When producing an executable that is linked statically with wxGTK
331 you'll be surprised at its immense size. This can sometimes be
332 drastically reduced by removing features from wxWindows that
333 are not used in your program. The most relevant such features
337 --with-odbc Enables ODBC code. This is disabled
338 by default because iODBC is under the
341 --without-libpng Disables PNG image format code.
343 --without-libjpeg Disables JPEG image format code.
345 --without-libtiff Disables TIFF image format code.
347 --disable-pnm Disables PNM image format code.
349 --disable-gif Disables GIF image format code.
351 --disable-pcx Disables PCX image format code.
353 --disable-resources Disables the use of *.wxr type
356 --disable-threads Disables threads. Will also
359 --disable-sockets Disables sockets.
361 --disable-dnd Disables Drag'n'Drop.
363 --disable-clipboard Disables Clipboard.
365 --disable-serial Disables object instance serialisation.
367 --disable-streams Disables the wxStream classes.
369 --disable-file Disables the wxFile class.
371 --disable-textfile Disables the wxTextFile class.
373 --disable-intl Disables the internationalisation.
375 --disable-validators Disables validators.
377 --disable-accel Disables accel.
380 Apart from disabling certain features you can very often "strip"
381 the program of its debugging information resulting in a significant
384 \subsubsection{Compiling
}
386 The following must be done in the base directory (e.g. ~/wxGTK
387 or ~/wxWin or whatever)
389 Now the makefiles are created (by configure) and you can compile
390 the library by typing:
396 make yourself some coffee, as it will take some time. On an old
397 386SX possibly two weeks. During compilation, you'll get a few
398 warning messages depending in your compiler.
400 If you want to be more selective, you can change into a specific
401 directory and type "make" there.
403 Then you may install the library and it's header files under
404 /usr/local/include/wx and /usr/local/lib respectively. You
405 have to log in as root (i.e. run "su" and enter the root
412 You can remove any traces of wxWindows by typing
418 If you want to save disk space by removing unnecessary
425 in the various directories will do the work for you.
427 \subsubsection{Creating a new Project
}
429 1\ket The first way uses the installed libraries and header files
430 automatically using wx-config
433 g++ myfoo.cpp `wx-config --cxxflags --libs` -o myfoo
436 Using this way, a make file for the minimal sample would look
443 $(CXX) -o minimal minimal.o `wx-config --libs`
445 minimal.o: minimal.cpp mondrian.xpm
446 $(CXX) `wx-config --cxxflags` -c minimal.cpp -o minimal.o
452 This is certain to become the standard way unless we decide
455 2\ket The other way creates a project within the source code
456 directories of wxWindows. For this endeavour, you'll need
457 GNU autoconf version
2.14 and add an entry to your Makefile.in
458 to the bottom of the configure.in script and run autoconf
459 and configure before you can type make.
461 \section{Windows
}\label{installwindows
}
464 \section{Mac
}\label{installmac
}
466 We don't have information about Mac installation at this time.