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