]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/gtk/install.txt
Added scrolling of widgets to GTK 2.0.
[wxWidgets.git] / docs / gtk / install.txt
... / ...
CommitLineData
1
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
4 example: wxGTK 2.3.0, egcs 1.1.1, Redhat 6.2 !!!
5
6* The most simple case
7-----------------------
8
9If you compile wxWindows on Linux for the first time and don't like to read
10install instructions just do (in the base dir):
11
12> ./configure --with-gtk
13> make
14> su <type root password>
15> make install
16> ldconfig
17> exit
18
19Afterwards you can continue with
20
21> make
22> su <type root password>
23> make install
24> ldconfig
25> exit
26
27If you want to remove wxWindows on Unix you can do this:
28
29> su <type root password>
30> make uninstall
31> ldconfig
32> exit
33
34* The expert case
35-----------------
36
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 concurrently. For this end, you have to create a directory for each build
40of wxWindows - you may also want to create different versions of wxWindows
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
43currently be installed, so you'd have to use local version of the library for
44that purpose.
45
46For building three versions (one GTK, one Motif and a debug version of the GTK
47source) you'd do this:
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
63../configure --with-gtk --enable-debug_flag
64make
65cd ..
66
67* The most simple errors
68------------------------
69
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
89you use gcc 2.8 you have to disable optimisation as the compiler will give up
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.
100
101* The most simple program
102-------------------------
103
104Now create your super-application myfoo.app and compile anywhere with
105
106gcc myfoo.cpp `wx-config --libs --cflags` -o myfoo
107
108* General
109-----------------------
110
111The Unix variants of wxWindows use GNU configure. If you have problems with your
112make use GNU make instead.
113
114If you have general problems with installation, read my homepage at
115
116 http://wesley.informatik.uni-freiburg.de/~wxxt
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
121YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
122
123* GUI libraries
124-----------------------
125
126wxWindows/GTK requires the GTK+ library to be installed on your system. It has
127to be a stable version, preferably version 1.2.10 (at least 1.2.3 is required,
1281.2.7 is strongly recommended).
129
130You can get the newest version of the GTK+ from the GTK homepage at:
131
132 http://www.gtk.org
133
134We also mirror GTK+ at my ftp site. You'll find information about downloading
135at my homepage.
136
137* Additional libraries
138-----------------------
139
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
143this, these Linux distributions have correct glibc 2 support:
144
145 - RedHat 5.1
146 - Debian 2.0
147 - Stampede
148 - DLD 6.0
149 - SuSE 6.0
150
151You can disable thread support by running
152
153./configure --disable-threads
154make
155su <type root password>
156make install
157ldconfig
158exit
159
160NB: DO NOT COMPILE WXGTK WITH GCC 2.7 AND THREADS, SINCE ALL PROGRAMS WILL CRASH UPON
161START-UP! Just always use egcs and be happy.
162
163* Building wxGTK on OS/2
164--------------------------
165
166Please send comments and question about the OS/2 installation
167to Andrea Venturoli <a.ventu@flashnet.it> and patches to
168the wxWindows mailing list.
169
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),
174sed (2.05), grep (2.0), Awk (3.0.3), GNU Make (3.76.1).
175
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__
180SET CFLAGS=-Zmtd -D__ST_MT_ERRNO__
181SET OSTYPE=OS2X
182SET COMSPEC=sh
183
184Notice you can choose whatever you want, if you don't like OS2X.
185
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
194disable threading by using the option --disable-threads.
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.
200
201* Building wxGTK on SGI
202--------------------------
203
204Using the SGI native compilers, it is recommended that you
205also set CFLAGS and CXXFLAGS before running configure. These
206should be set to :
207
208CFLAGS="-mips3 -n32"
209CXXFLAGS="-mips3 -n32"
210
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
215untested).
216
217The SGI native compiler support has only been tested on Irix 6.5.
218
219* Create your configuration
220-----------------------------
221
222Usage:
223 ./configure options
224
225If you want to use system's C and C++ compiler,
226set environment variables CC and CCC as
227
228 % setenv CC cc
229 % setenv CCC CC
230 % ./configure options
231
232to see all the options please use:
233
234 ./configure --help
235
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.
240
241
242* General options
243-------------------
244
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
249Normally, you won't have to choose a toolkit, because when
250you download wxGTK, it will default to --with-gtk etc. But
251if you use all of our CVS repository you have to choose a
252toolkit. You must do this by running configure with either of:
253
254 --with-gtk Use the GIMP ToolKit (GTK). Default.
255
256 --with-motif Use either Motif or Lesstif
257 Configure will look for both.
258
259The following options handle the kind of library you want to build.
260
261 --disable-threads Compile without thread support.
262
263 --disable-shared Do not create shared libraries, but
264 build static libraries instead.
265
266 --disable-optimise Do not optimise the code. Can
267 sometimes be useful for debugging
268 and is required on some architectures
269 such as Sun with gcc 2.8.X which
270 would otherwise produce segvs.
271
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
278 binary size.
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
283 binary size. Also fewer crashes during the
284 actual compilation...
285
286 --enable-no_deps Enable compilation without creation of
287 dependency information.
288
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
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
305 useful internal debugging tricks (such
306 as automatically reporting illegal calls)
307 to work. Note that program and library
308 must be compiled with the same debug
309 options.
310
311* Feature Options
312-------------------
313
314When producing an executable that is linked statically with wxGTK
315you'll be surprised at its immense size. This can sometimes be
316drastically reduced by removing features from wxWindows that
317are not used in your program. The most relevant such features
318are
319
320 --with-odbc Enables ODBC code. This is disabled
321 by default because iODBC is under the
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
349 --disable-serial Disables object instance serialisation.
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
363Apart from disabling certain features you can very often "strip"
364the program of its debugging information resulting in a significant
365reduction in size.
366
367* Compiling
368-------------
369
370The following must be done in the base directory (e.g. ~/wxGTK
371or ~/wxWin or whatever)
372
373Now the makefiles are created (by configure) and you can compile
374the library by typing:
375
376 make
377
378make yourself some coffee, as it will take some time. On an old
379386SX possibly two weeks. During compilation, you'll get a few
380warning messages depending in your compiler.
381
382If you want to be more selective, you can change into a specific
383directory and type "make" there.
384
385Then you may install the library and its header files under
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
390 make install
391
392You can remove any traces of wxWindows by typing
393
394 make uninstall
395
396If you want to save disk space by removing unnecessary
397object-files:
398
399make clean
400
401in the various directories will do the work for you.
402
403* Creating a new Project
404--------------------------
405
4061) The first way uses the installed libraries and header files
407automatically using wx-config
408
409gcc myfoo.cpp `wx-config --cflags --libs` -o myfoo
410
411Using this way, a make file for the minimal sample would look
412like this
413
414CC = gcc
415
416minimal: minimal.o
417 $(CC) -o minimal minimal.o `wx-config --libs`
418
419minimal.o: minimal.cpp mondrian.xpm
420 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
421
422clean:
423 rm -f *.o minimal
424
425This is certain to become the standard way unless we decide
426to stick to tmake.
427
4282) The other way creates a project within the source code
429directories of wxWindows. For this endeavour, you'll need
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.
433
434----------------------
435
436In the hope that it will be useful,
437
438 Robert Roebling
439