]> git.saurik.com Git - wxWidgets.git/blame - docs/gtk/install.txt
don't override INSTALL as install path is made absolute in configure
[wxWidgets.git] / docs / gtk / install.txt
CommitLineData
8e1e6fac 1
2e1e7f9d
VZ
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
fb1bd1bd 4 example: wxGTK 2.3.0, egcs 1.1.1, Redhat 6.2 !!!
8e1e6fac 5
c98f0421
RR
6* The most simple case
7-----------------------
8
2e1e7f9d 9If you compile wxWindows on Linux for the first time and don't like to read
91b8de8d 10install instructions just do (in the base dir):
c98f0421 11
9b61f868
RR
12> ./configure --with-gtk
13> make
14> su <type root password>
15> make install
16> ldconfig
17> exit
034be888 18
9b61f868
RR
19Afterwards you can continue with
20
21> make
22> su <type root password>
23> make install
24> ldconfig
25> exit
4dcaf11a 26
8e1e6fac
RR
27If you want to remove wxWindows on Unix you can do this:
28
9b61f868
RR
29> su <type root password>
30> make uninstall
31> ldconfig
32> exit
cf7a7e13 33
2b62ab35
RR
34* The expert case
35-----------------
36
2e1e7f9d
VZ
37If you want to do some more serious cross-platform programming with wxWindows,
38such as for GTK and Motif, you can now build two complete libraries and use
2edb0bde 39them concurrently. For this end, you have to create a directory for each build
91b8de8d 40of wxWindows - you may also want to create different versions of wxWindows
2e1e7f9d 41and test them concurrently. Most typically, this would be a version configured
2edb0bde
VZ
42with --enable-debug_flag and one without. Note, that only one build can
43currently be installed, so you'd have to use local version of the library for
44that purpose.
45
2e1e7f9d 46For building three versions (one GTK, one Motif and a debug version of the GTK
51d55e1c 47source) you'd do this:
2b62ab35
RR
48
49md buildmotif
50cd buildmotif
51../configure --with-motif
52make
53cd ..
54
55md buildgtk
56cd buildgtk
57../configure --with-gtk
58make
59cd ..
60
61md buildgtkd
62cd buildgtkd
51d55e1c 63../configure --with-gtk --enable-debug_flag
2b62ab35
RR
64make
65cd ..
66
2a29700e
RR
67* The most simple errors
68------------------------
69
2e1e7f9d
VZ
70For any configure errors: please look at config.log file which was generated
71during configure run, it usually contains some useful information.
72
73configure reports, that you don't have GTK 1.2 installed although you are
74very sure you have. Well, you have installed it, but you also have another
75version of the GTK installed, which you may need to remove including other
76versions of glib (and its headers). Or maybe you installed it in non default
77location and configure can't find it there, so please check that your PATH
78variable includes the path to the correct gtk-config. Also check that your
79LD_LIBRARY_PATH or equivalent variable contains the path to GTK+ libraries if
80they were installed in a non default location.
81
82You get errors from make: please use GNU make instead of the native make
83program. Currently wxWindows can be built only with GNU make, BSD make and
84Solaris make. Other versions might work or not (any which don't have VPATH
85support definitely won't).
86
87You get errors during compilation: The reason is that you probably have a
88broken compiler, which includes a lot of old gcc versions. In particular, if
2edb0bde 89you use gcc 2.8 you have to disable optimisation as the compiler will give up
2e1e7f9d
VZ
90with an internal compiler error.
91
92You get immediate segfault when starting any sample or application: This is
93either due to having compiled the library with different flags or options than
94your program - typically you might have the __WXDEBUG__ option set for the
95library but not for your program - or due to using a broken compiler (and its
96optimisation) such as gcc 2.8.
97
98Linker complains about missing PROIO_yy_flex_alloc and similar symbols: you
99probably have an old version of flex, 2.5.4 is recommended.
3502e687 100
2a29700e
RR
101* The most simple program
102-------------------------
103
91b8de8d 104Now create your super-application myfoo.app and compile anywhere with
cf7a7e13 105
bbeb6c2b 106gcc myfoo.cpp `wx-config --libs --cflags` -o myfoo
c98f0421
RR
107
108* General
109-----------------------
110
2e1e7f9d 111The Unix variants of wxWindows use GNU configure. If you have problems with your
91b8de8d 112make use GNU make instead.
c98f0421 113
2e1e7f9d 114If you have general problems with installation, read my homepage at
c98f0421
RR
115
116 http://wesley.informatik.uni-freiburg.de/~wxxt
2e1e7f9d
VZ
117
118for newest information. If you still don't have any success, please send a bug
119report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
120YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF GTK, WXGTK, WHAT DISTRIBUTION
91b8de8d 121YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
c98f0421
RR
122
123* GUI libraries
124-----------------------
125
2e1e7f9d 126wxWindows/GTK requires the GTK+ library to be installed on your system. It has
2edb0bde 127to be a stable version, preferably version 1.2.10 (at least 1.2.3 is required,
2e1e7f9d 1281.2.7 is strongly recommended).
91b8de8d
RR
129
130You can get the newest version of the GTK+ from the GTK homepage at:
c98f0421 131
c98f0421 132 http://www.gtk.org
2e1e7f9d
VZ
133
134We also mirror GTK+ at my ftp site. You'll find information about downloading
91b8de8d 135at my homepage.
2e1e7f9d 136
c98f0421
RR
137* Additional libraries
138-----------------------
139
2e1e7f9d
VZ
140wxWindows/Gtk requires a thread library and X libraries known to work with threads.
141This is the case on all commercial Unix-Variants and all Linux-Versions that are
142based on glibc 2 except RedHat 5.0 which is broken in many aspects. As of writing
91b8de8d 143this, these Linux distributions have correct glibc 2 support:
58614078
RR
144
145 - RedHat 5.1
146 - Debian 2.0
147 - Stampede
4f22cf8d 148 - DLD 6.0
cffee23b 149 - SuSE 6.0
58614078 150
2e1e7f9d
VZ
151You can disable thread support by running
152
153./configure --disable-threads
58614078 154make
034be888 155su <type root password>
8710cf5c 156make install
034be888
RR
157ldconfig
158exit
2e1e7f9d
VZ
159
160NB: DO NOT COMPILE WXGTK WITH GCC 2.7 AND THREADS, SINCE ALL PROGRAMS WILL CRASH UPON
91b8de8d 161START-UP! Just always use egcs and be happy.
3502e687 162
91b8de8d
RR
163* Building wxGTK on OS/2
164--------------------------
c98f0421 165
91b8de8d
RR
166Please send comments and question about the OS/2 installation
167to Andrea Venturoli <a.ventu@flashnet.it> and patches to
510fc784 168the wxWindows mailing list.
c98f0421 169
2e1e7f9d
VZ
170You'll need OS/2 Warp (4.00FP#6), X-Free86/2 (3.3.3 or newer),
171GTK+ (1.2.5 or newer), emx (0.9d fix 1), flex (2.5.4), yacc (1.8),
172korn shell (5.2.13), Autoconf (2.13), GNU file utilities (3.6),
173GNU text utilities (1.3), GNU shell utilites (1.12), m4 (1.4),
91b8de8d 174sed (2.05), grep (2.0), Awk (3.0.3), GNU Make (3.76.1).
c98f0421 175
91b8de8d
RR
176Open an OS/2 prompt and switch to the directory above.
177First set some global environment variables we need:
178
179SET CXXFLAGS=-Zmtd -D__ST_MT_ERRNO__
9f2d09aa 180SET CFLAGS=-Zmtd -D__ST_MT_ERRNO__
2e1e7f9d 181SET OSTYPE=OS2X
91b8de8d
RR
182SET COMSPEC=sh
183
184Notice you can choose whatever you want, if you don't like OS2X.
185
ea0dbf30
SN
186Now, run autoconf in the main directory and in the samples, demos
187and utils subdirectory. This will generate the OS/2 specific
188versions of the configure scripts. Now run
189 configure --with-gtk
190as described above.
191
192If you have pthreads library installed, but have a gtk version
193which does not yet support threading, you need to explicitly
2edb0bde 194disable threading by using the option --disable-threads.
ea0dbf30
SN
195
196Note that configure assumes your flex will generate files named
197"lexyy.c", not "lex.yy.c". If you have a version which does
198generate "lex.yy.c", you need to manually change the generated
199makefile.
9f2d09aa 200
91b8de8d
RR
201* Building wxGTK on SGI
202--------------------------
c98f0421
RR
203
204Using the SGI native compilers, it is recommended that you
2e1e7f9d 205also set CFLAGS and CXXFLAGS before running configure. These
c98f0421
RR
206should be set to :
207
2e1e7f9d 208CFLAGS="-mips3 -n32"
c98f0421
RR
209CXXFLAGS="-mips3 -n32"
210
2e1e7f9d
VZ
211This is essential if you want to use the resultant binaries
212on any other machine than the one it was compiled on. If you
213have a 64bit machine (Octane) you should also do this to ensure
214you don't accidently build the libraries as 64bit (which is
c98f0421
RR
215untested).
216
217The SGI native compiler support has only been tested on Irix 6.5.
218
91b8de8d
RR
219* Create your configuration
220-----------------------------
221
222Usage:
2e1e7f9d 223 ./configure options
91b8de8d
RR
224
225If you want to use system's C and C++ compiler,
226set environment variables CC and CCC as
227
2e1e7f9d
VZ
228 % setenv CC cc
229 % setenv CCC CC
230 % ./configure options
91b8de8d 231
c98f0421
RR
232to see all the options please use:
233
2e1e7f9d 234 ./configure --help
c98f0421 235
2e1e7f9d
VZ
236It is recommended to build wxWindows in another directory (maybe a
237subdirectory of your wxWindows installation) as this allows you to
238have multiple configurations (for example, debug and release or GTK
239and Motif) simultaneously.
c98f0421
RR
240
241
242* General options
243-------------------
244
77c85c2b
RR
245Given below are the commands to change the default behaviour,
246i.e. if it says "--disable-threads" it means that threads
247are enabled by default.
248
cf7a7e13
RR
249Normally, you won't have to choose a toolkit, because when
250you download wxGTK, it will default to --with-gtk etc. But
2e1e7f9d 251if you use all of our CVS repository you have to choose a
cf7a7e13 252toolkit. You must do this by running configure with either of:
c98f0421 253
4b6b4dfc 254 --with-gtk Use the GIMP ToolKit (GTK). Default.
2e1e7f9d
VZ
255
256 --with-motif Use either Motif or Lesstif
257 Configure will look for both.
c98f0421
RR
258
259The following options handle the kind of library you want to build.
260
2e1e7f9d 261 --disable-threads Compile without thread support.
c98f0421 262
2e1e7f9d 263 --disable-shared Do not create shared libraries, but
4b6b4dfc 264 build static libraries instead.
bbeb6c2b 265
2e1e7f9d
VZ
266 --disable-optimise Do not optimise the code. Can
267 sometimes be useful for debugging
4b6b4dfc
RR
268 and is required on some architectures
269 such as Sun with gcc 2.8.X which
270 would otherwise produce segvs.
c98f0421 271
2e1e7f9d
VZ
272 --enable-profile Add profiling info to the object
273 files. Currently broken, I think.
274
275 --enable-no_rtti Enable compilation without creation of
276 C++ RTTI information in object files.
277 This will speed-up compilation and reduce
4b6b4dfc 278 binary size.
2e1e7f9d
VZ
279
280 --enable-no_exceptions Enable compilation without creation of
281 C++ exception information in object files.
282 This will speed-up compilation and reduce
4b6b4dfc
RR
283 binary size. Also fewer crashes during the
284 actual compilation...
2e1e7f9d
VZ
285
286 --enable-no_deps Enable compilation without creation of
287 dependency information.
288
2edb0bde
VZ
289 --enable-permissive Enable compilation without checking for strict
290 ANSI conformance. Useful to prevent the build
291 dying with errors as soon as you compile with
2e1e7f9d
VZ
292 Solaris' ANSI-defying headers.
293
294 --enable-mem_tracing Add built-in memory tracing.
295
296 --enable-dmalloc Use the dmalloc memory debugger.
297 Read more at www.letters.com/dmalloc/
298
299 --enable-debug_info Add debug info to object files and
300 executables for use with debuggers
301 such as gdb (or its many frontends).
302
303 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
304 compiling. This enable wxWindows' very
4b6b4dfc
RR
305 useful internal debugging tricks (such
306 as automatically reporting illegal calls)
307 to work. Note that program and library
2e1e7f9d 308 must be compiled with the same debug
4b6b4dfc 309 options.
c98f0421
RR
310
311* Feature Options
312-------------------
313
3cdda6cd
RR
314When producing an executable that is linked statically with wxGTK
315you'll be surprised at its immense size. This can sometimes be
2e1e7f9d 316drastically reduced by removing features from wxWindows that
3cdda6cd
RR
317are not used in your program. The most relevant such features
318are
319
2e1e7f9d 320 --with-odbc Enables ODBC code. This is disabled
cc977e5f 321 by default because iODBC is under the
2e1e7f9d
VZ
322 L-GPL license which is less liberal than
323 wxWindows license.
324
325 --without-libpng Disables PNG image format code.
326
327 --without-libjpeg Disables JPEG image format code.
328
329 --without-libtiff Disables TIFF image format code.
330
331 --disable-pnm Disables PNM image format code.
332
333 --disable-gif Disables GIF image format code.
334
335 --disable-pcx Disables PCX image format code.
336
337 --disable-iff Disables IFF image format code.
338
339 --disable-resources Disables the use of *.wxr type resources.
340
341 --disable-threads Disables threads. Will also disable sockets.
342
343 --disable-sockets Disables sockets.
344
345 --disable-dnd Disables Drag'n'Drop.
346
347 --disable-clipboard Disables Clipboard.
348
2edb0bde 349 --disable-serial Disables object instance serialisation.
2e1e7f9d
VZ
350
351 --disable-streams Disables the wxStream classes.
352
353 --disable-file Disables the wxFile class.
354
355 --disable-textfile Disables the wxTextFile class.
356
357 --disable-intl Disables the internationalisation.
358
359 --disable-validators Disables validators.
360
361 --disable-accel Disables accelerators support.
362
3cdda6cd
RR
363Apart from disabling certain features you can very often "strip"
364the program of its debugging information resulting in a significant
365reduction in size.
c98f0421
RR
366
367* Compiling
368-------------
369
370The following must be done in the base directory (e.g. ~/wxGTK
cf7a7e13 371or ~/wxWin or whatever)
c98f0421 372
2e1e7f9d 373Now the makefiles are created (by configure) and you can compile
8710cf5c 374the library by typing:
c98f0421 375
2e1e7f9d 376 make
c98f0421 377
8710cf5c 378make yourself some coffee, as it will take some time. On an old
2e1e7f9d 379386SX possibly two weeks. During compilation, you'll get a few
3cdda6cd 380warning messages depending in your compiler.
c98f0421 381
51d55e1c 382If you want to be more selective, you can change into a specific
2edb0bde 383directory and type "make" there.
c98f0421 384
2edb0bde 385Then you may install the library and its header files under
cf7a7e13
RR
386/usr/local/include/wx and /usr/local/lib respectively. You
387have to log in as root (i.e. run "su" and enter the root
388password) and type
389
2e1e7f9d 390 make install
c98f0421 391
8e1e6fac 392You can remove any traces of wxWindows by typing
c98f0421 393
8e1e6fac 394 make uninstall
2e1e7f9d 395
3cdda6cd 396If you want to save disk space by removing unnecessary
c98f0421
RR
397object-files:
398
2e1e7f9d 399make clean
c98f0421 400
3cdda6cd 401in the various directories will do the work for you.
c98f0421
RR
402
403* Creating a new Project
404--------------------------
405
f3cb6592
RR
4061) The first way uses the installed libraries and header files
407automatically using wx-config
408
cc977e5f 409gcc myfoo.cpp `wx-config --cflags --libs` -o myfoo
f3cb6592
RR
410
411Using this way, a make file for the minimal sample would look
412like this
413
cc977e5f 414CC = gcc
f3cb6592
RR
415
416minimal: minimal.o
2e1e7f9d 417 $(CC) -o minimal minimal.o `wx-config --libs`
f3cb6592
RR
418
419minimal.o: minimal.cpp mondrian.xpm
2e1e7f9d 420 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
f3cb6592 421
2e1e7f9d 422clean:
f3cb6592
RR
423 rm -f *.o minimal
424
425This is certain to become the standard way unless we decide
2edb0bde 426to stick to tmake.
f3cb6592 427
2e1e7f9d 4282) The other way creates a project within the source code
8e1e6fac 429directories of wxWindows. For this endeavour, you'll need
79144b8a
RR
430GNU autoconf version 2.14 and add an entry to your Makefile.in
431to the bottom of the configure.in script and run autoconf
432and configure before you can type make.
cf7a7e13 433
91b8de8d 434----------------------
c98f0421
RR
435
436In the hope that it will be useful,
437
510fc784
RR
438 Robert Roebling
439