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: wxWINE 2.1 snapshot 6, egcs 1.1.1, Redhat 5.0 !!!
9 Most C++ compilers cannot compile the WINE sources yet (this includes
10 all versions of g++ and egcs) so you have to make a minimal change
11 and recompile all of WINE in order to get anywhere.
13 (Note: this information may be out of date now. See notes at
14 the bottom of this file.)
16 This change has do be applied to the /include/windef.h file, line 59
17 in the section "Calling convention definitions", where the sources
22 which has to be changed into
26 After this change, you'll have to recompile all of WINE without
27 forgetting to install it. The direct consequence of this change
28 is that the Win32 binary emulator won't work anymore, as the
29 change disables the Windows native calling convention.
31 * The most simple case
32 -----------------------
34 If you compile wxWindows on Linux for the first time and don't like to read
35 install instructions just do (in the base dir):
37 > ./configure --with-wine
39 > su <type root password>
44 On all variants of Unix except Linux (and maybe except *BSD), shared libraries
45 are not supported out of the box due to the utter stupidity of libtool, so you'll
46 have to do this to get shared library support:
48 > ./configure --with-wine --disable-static --enable-shared
50 Then you'll have to edit the wrongly created libtool script. There are two
51 important entries with respect to shared library creation, which are
53 archive_cmds="\$LD -shared ....
54 archive_expsym_cmds="\$LD -shared ....
56 which should be something like
58 archive_cmds="\$CC -shared ....
59 archive_expsym_cmds="\$CC -shared ....
61 Afterwards you can continue with
64 > su <type root password>
69 If you want to remove wxWindows on Unix you can do this:
71 > su <type root password>
79 If you want to do some more serious cross-platform programming with wxWindows,
80 such as for GTK and Motif, you can now build two complete libraries and use
81 them concurrently. For this end, you have to create a directory for each build
82 of wxWindows - you may also want to create different versions of wxWindows
83 and test them concurrently. Most typically, this would be a version configured
84 with --enable-debug_flag and one without. Note, that only one build can currently
85 be installed, so you'd have to use local version of the library for that purpose.
86 For building three versions (one GTK, one WINE and a debug version of the WINE
87 source) you'd do this:
91 ../configure --with-motif
97 ../configure --with-wine
103 ../configure --with-wine --enable-debug_flag
107 * The most simple errors
108 ------------------------
110 wxWINE doesn't work yet as WINE isn't really up to the task yet.
112 You get errors during compilation: The reason is that you probably have a broken
113 compiler, which includes almost everything that is called gcc. If you use gcc 2.8
114 you have to disable optimisation as the compiler will give up with an internal
117 If there is just any way for you to use egcs, use egcs. We cannot fix gcc.
119 You get immediate segfault when starting any sample or application: This is either
120 due to having compiled the library with different flags or options than your program -
121 typically you might have the __WXDEBUG__ option set for the library but not for your
122 program - or due to using a broken compiler (and its optimisation) such as GCC 2.8.
124 * The most simple program
125 -------------------------
127 Now create your super-application myfoo.app and compile anywhere with
129 g++ myfoo.cpp `wx-config --libs --cflags` -o myfoo
132 -----------------------
134 The Unix variants of wxWindows use GNU configure. If you have problems with your
135 make use GNU make instead.
137 If you have general problems with installation, read my homepage at
139 http://wesley.informatik.uni-freiburg.de/~wxxt
141 for newest information. If you still don't have any success, please send a bug
142 report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
143 YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF WINE, WXWINE, WHAT DISTRIBUTION
144 YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect, but I tried...
147 -----------------------
149 wxWindows/WINE requires the WINE library to be installed on your system.
151 You can get the newest version of the WINE from the WINE homepage at:
153 http://www.winehq.com
155 * Create your configuration
156 -----------------------------
161 If you want to use system's C and C++ compiler,
162 set environment variables CC and CCC as
166 % ./configure options
168 to see all the options please use:
172 The basic philosophy is that if you want to use different
173 configurations, like a debug and a release version,
174 or use the same source tree on different systems,
175 you have only to change the environment variable OSTYPE.
176 (Sadly this variable is not set by default on some systems
177 in some shells - on SGI's for example). So you will have to
178 set it there. This variable HAS to be set before starting
179 configure, so that it knows which system it tries to
182 Configure will complain if the system variable OSTYPE has
183 not been defined. And Make in some circumstances as well...
189 Given below are the commands to change the default behaviour,
190 i.e. if it says "--disable-threads" it means that threads
191 are enabled by default.
193 Many of the configure options have been thoroughly tested
194 in wxWindows snapshot 6, but not yet all (ODBC not).
196 You must do this by running configure with either of:
198 --with-wine Use the WINE library
200 The following options handle the kind of library you want to build.
202 --enable-threads Compile with thread support. Threads
203 support is also required for the
206 --disable-shared Do not create shared libraries.
208 --disable-optimise Do not optimise the code. Can
209 sometimes be useful for debugging
210 and is required on some architectures
211 such as Sun with gcc 2.8.X which
212 would otherwise produce segvs.
214 --enable-profile Add profiling info to the object
215 files. Currently broken, I think.
217 --enable-no_rtti Enable compilation without creation of
218 C++ RTTI information in object files.
219 This will speed-up compilation and reduce
222 --enable-no_exceptions Enable compilation without creation of
223 C++ exception information in object files.
224 This will speed-up compilation and reduce
225 binary size. Also fewer crashes during the
226 actual compilation...
228 --enable-mem_tracing Add built-in memory tracing.
230 --enable-dmalloc Use the dmalloc memory debugger.
231 Read more at www.letters.com/dmalloc/
233 --enable-debug_info Add debug info to object files and
234 executables for use with debuggers
235 such as gdb (or its many frontends).
237 --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
238 compiling. This enable wxWindows' very
239 useful internal debugging tricks (such
240 as automatically reporting illegal calls)
241 to work. Note that program and library
242 must be compiled with the same debug
248 Many of the configure options have been thoroughly tested
249 in wxWindows snapshot 6, but not yet all (ODBC not).
251 When producing an executable that is linked statically with wxGTK
252 you'll be surprised at its immense size. This can sometimes be
253 drastically reduced by removing features from wxWindows that
254 are not used in your program. The most relevant such features
257 --without-libpng Disables PNG image format code.
259 --without-libjpeg Disables JPEG image format code.
261 { --without-odbc Disables ODBC code. Not yet. }
263 --disable-resources Disables the use of *.wxr type
266 --disable-threads Disables threads. Will also
269 --disable-sockets Disables sockets.
271 --disable-dnd Disables Drag'n'Drop.
273 --disable-clipboard Disables Clipboard.
275 --disable-serial Disables object instance serialisation.
277 --disable-streams Disables the wxStream classes.
279 --disable-file Disables the wxFile class.
281 --disable-textfile Disables the wxTextFile class.
283 --disable-intl Disables the internationalisation.
285 --disable-validators Disables validators.
287 --disable-accel Disables accel.
289 Apart from disabling certain features you can very often "strip"
290 the program of its debugging information resulting in a significant
296 The following must be done in the base directory (e.g. ~/wxGTK
297 or ~/wxWin or whatever)
299 Now the makefiles are created (by configure) and you can compile
300 the library by typing:
304 make yourself some coffee, as it will take some time. On an old
305 386SX possibly two weeks. During compilation, you'll get a few
306 warning messages depending in your compiler.
308 If you want to be more selective, you can change into a specific
309 directory and type "make" there.
311 Then you may install the library and its header files under
312 /usr/local/include/wx and /usr/local/lib respectively. You
313 have to log in as root (i.e. run "su" and enter the root
318 You can remove any traces of wxWindows by typing
322 If you want to save disk space by removing unnecessary
327 in the various directories will do the work for you.
329 * Creating a new Project
330 --------------------------
332 1) The first way uses the installed libraries and header files
333 automatically using wx-config
335 g++ myfoo.cpp `wx-config --libs` `wx-config --cflags` -o myfoo
337 Using this way, a make file for the minimal sample would look
343 $(CC) -o minimal minimal.o `wx-config --libs`
345 minimal.o: minimal.cpp mondrian.xpm
346 $(CC) `wx-config --cflags` -c minimal.cpp -o minimal.o
351 This is certain to become the standard way unless we decide
354 2) The other way creates a project within the source code
355 directories of wxWindows. For this endeavour, you'll need
356 the usual number of GNU tools, at least
358 GNU automake version 1.4
359 GNU autoheader version 2.14
360 GNU autoconf version 2.14
361 GNU libtool version 1.3
368 and if you have all this then you probably know enough to
369 go ahead yourself :-)
371 ----------------------
373 In the hope that it will be useful,
375 Robert Roebling <roebling@sun2.ruf.uni-freiburg.de>
378 Addition notes by Julian Smart, August 2002
379 ===========================================
381 I've fixed some compile errors, and got as far as
382 compiling wxWINE, but actually linking a sample will take
385 To compile wxWINE, export these variables:
387 export CPPFLAGS=-I/usr/local/include/wine
388 export LDFLAGS=-L/usr/local/lib/wine
392 configure --disable-static --enable-shared --enable-gui \
393 --with-wine --without-libpng --enable-debug_flag --enable-log \
394 --enable-debug_info --enable-ole --enable-clipboard --enable-dataobj \
395 --enable-debug --enable-threads --disable-sockets \
396 --with-libjpeg --enable-debug_cntxt
398 Compiling a sample won't work yet because 'winebuild' needs
399 to be called, and the resuling C file compiled and linked.
400 Plus, Windows DLLs need to be imported.
402 Note that the documentation on the WINE web site on using
403 winebuild is out of date (August 2002) -- the spec file no
404 longer supports import and type keywords. Instead look at
405 samples in the WINE 'programs' directory for inspiration
406 and compile options to use. It's probable that the
407 wxWINE library will need recompiling with different options.
409 Any progress on this front will be very welcome.