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