install.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. wxWidgets for Motif installation
  2. --------------------------------
  3. IMPORTANT NOTE:
  4. If you experience problems installing, please re-read these
  5. instructions and other related files (todo.txt, bugs.txt and
  6. osname.txt for your platform if it exists) carefully before
  7. mailing wx-users or the author. Preferably, try to fix the
  8. problem first and then send a patch to the author.
  9. When sending bug reports tell us what version of wxWidgets you are
  10. using (including the beta) and what compiler on what system. One
  11. example: wxMotif 2.8.1, gcc 2.95.4, Redhat 6.1
  12. First steps
  13. -----------
  14. - Prerequisites: Motif 1.2 or above, or Lesstif. Motif 2.0 and
  15. above may also be suitable.
  16. - Download wxX11-x.y.z.tgz, where x.y.z is the version number.
  17. (wxMotif is included in the wxX11 distribution).
  18. Download documentation in a preferred format, such as
  19. wxWidgets-HTML.zip or wxWidgets-PDF.zip.
  20. - Make a directory such as ~/wx and unarchive the files into this
  21. directory.
  22. - It is recommended that you install bison and flex; using yacc
  23. and lex may require tweaking of the makefiles. You also need
  24. libXpm (see comments in the Notes section below) if you want to have
  25. XPM support in wxWidgets (recommended).
  26. - You can now use configure to build wxWidgets and the samples.
  27. Using configure is the only way to build the library. If it doesn't
  28. work for you for whatever reason, please report it (together with detailed
  29. information about your platform and the (relevant part of) contents of
  30. config.log file) to wx-dev@lists.wxwidgets.org.
  31. COMPILING USING CONFIGURE
  32. =========================
  33. * The simplest case
  34. -------------------
  35. If you compile wxWidgets on Linux for the first time and don't like to read
  36. install instructions just do (in the base dir):
  37. > ./configure --with-motif
  38. > make
  39. > su <type root password>
  40. > make install
  41. > ldconfig
  42. > exit
  43. Afterwards you can continue with
  44. > make
  45. > su <type root password>
  46. > make install
  47. > ldconfig
  48. > exit
  49. If you want to remove wxWidgets on Unix you can do this:
  50. > su <type root password>
  51. > make uninstall
  52. > ldconfig
  53. > exit
  54. * The expert case
  55. -----------------
  56. If you want to do some more serious cross-platform programming with wxWidgets,
  57. such as for GTK and Motif, you can now build two complete libraries and use
  58. them concurrently. For this end, you have to create a directory for each build
  59. of wxWidgets - you may also want to create different versions of wxWidgets
  60. and test them concurrently. Most typically, this would be a version configured
  61. with --enable-debug and one without.
  62. For building three versions (one GTK, one Motif and a debug version of the GTK
  63. source) you'd do this:
  64. mkdir buildmotif
  65. cd buildmotif
  66. ../configure --with-motif
  67. make
  68. cd ..
  69. mkdir buildgtk
  70. cd buildgtk
  71. ../configure --with-gtk
  72. make
  73. cd ..
  74. mkdir buildgtkd
  75. cd buildgtkd
  76. ../configure --with-gtk --enable-debug
  77. make
  78. cd ..
  79. Note that since wxWidgets-2.6.0 you can install all those libraries
  80. concurrently, you just need to pass the appropriate flags when using them.
  81. * The simplest errors
  82. ---------------------
  83. You get errors during compilation: The reason is that you probably have a
  84. broken compiler. GCC 2.8 and earlier versions and egcs are likely to cause
  85. problems due to incomplete support for C++ and optimisation bugs. Best to use
  86. GCC 2.95 or later.
  87. You get immediate segfault when starting any sample or application: This is
  88. either due to having compiled the library with different flags or options than
  89. your program - typically you might have the __WXDEBUG__ option set for the
  90. library but not for your program - or due to using a compiler with optimisation
  91. bugs.
  92. * The simplest program
  93. ----------------------
  94. Now create your super-application myfoo.app and compile anywhere with
  95. g++ myfoo.cpp `wx-config --libs --cxxflags` -o myfoo
  96. * General
  97. ---------
  98. The Unix variants of wxWidgets use GNU configure. If you have problems with
  99. your make use GNU make instead.
  100. If you have general problems with installation, see the wxWidgets website at
  101. http://www.wxwidgets.org/
  102. for newest information. If you still don't have any success, please send a bug
  103. report to one of our mailing lists (see my homepage) INCLUDING A DESCRIPTION OF
  104. YOUR SYSTEM AND YOUR PROBLEM, SUCH AS YOUR VERSION OF MOTIF, WXMOTIF, WHAT
  105. DISTRIBUTION YOU USE AND WHAT ERROR WAS REPORTED. I know this has no effect,
  106. but I tried...
  107. * GUI libraries
  108. ---------------
  109. wxWidgets/Motif requires the Motif library to be installed on your system. As
  110. an alternative, you may also use the free library "lesstif" which implements
  111. most of the Motif API without the licence restrictions of Motif.
  112. You can get the newest version of the Lesstif from the lesstif homepage at:
  113. http://www.lesstif.org/
  114. * Additional libraries
  115. ----------------------
  116. wxWidgets/Motif requires a thread library and X libraries known to work with
  117. threads. This is the case on all commercial Unix-Variants and all
  118. Linux-Versions that are based on glibc 2 except RedHat 5.0 which is broken in
  119. many aspects. As of writing this, virtually all Linux distributions have
  120. correct glibc 2 support.
  121. You can disable thread support by running
  122. ./configure --disable-threads
  123. make
  124. su <type root password>
  125. make install
  126. ldconfig
  127. exit
  128. * Building wxMotif on OS/2
  129. --------------------------
  130. Please send comments and question about the OS/2 installation
  131. to Stefan Neis <Stefan.Neis@t-online.de> and patches to
  132. the wxWidgets mailing list.
  133. In the following list, the version numbers indicate the configuration that
  134. was actually used by myself, newer version should cause no problems and
  135. even older ones are expected to work most of the time.
  136. You'll need OS/2 Warp (4.51) or eCS(1.0), X-Free86/2 (3.3.6 or newer),
  137. Lesstif (0.92.7 or newer), emx (0.9d fix 4), a Unix like shell (pdksh-5.2.14
  138. or ash), Autoconf (2.57), GNU file utilities (3.13), GNU text utilities (1.19),
  139. GNU shell utilites (1.12), m4 (1.4), sed (2.05), grep (2.0), Awk (3.0.3),
  140. GNU Make (3.75).
  141. Preferably, you should have Posix/2 installed and C(PLUS)_INCLUDE_PATH and
  142. LIBRARY_PATH set up accordingly, however, wxGTK will even work without it.
  143. Presence of Posix/2 will be auto-detected.
  144. Open an OS/2 prompt and switch to the directory above.
  145. Set MAKESHELL or MAKE_SHELL (which one is needed depends on the version of
  146. make) to a Unix like shell, e.g.
  147. SET MAKESHELL=ash
  148. If you have a really deficient version of GNU make, it might even be
  149. necessary to set SHELL or even COMSPEC to a unix like shell as well.
  150. Depending on your installation you might want to also set INSTALL, for me
  151. it tends to try to use the system's tcpip\pcomos\install.exe which causes
  152. problems, e.g.
  153. SET INSTALL=<path_to_src_directory>/install-sh -c
  154. Notice that the delivered configure scripts are fully OS/2 aware, so you
  155. can simply run
  156. ash -c "configure --with-motif"
  157. and make and possibly make install as described above.
  158. To verify Lesstif installation, configure will try to compile a
  159. sample program that requires X headers/libraries to be either
  160. available via C_INCLUDE_PATH and LIBRARY_PATH or you need to
  161. explicitly set CFLAGS prior to running configure.
  162. * Building wxMotif on SGI
  163. -------------------------
  164. Using the SGI native compilers, it is recommended that you
  165. also set CFLAGS and CXXFLAGS before running configure. These
  166. should be set to :
  167. CFLAGS="-mips3 -n32"
  168. CXXFLAGS="-mips3 -n32"
  169. This is essential if you want to use the resultant binaries
  170. on any other machine than the one it was compiled on. If you
  171. have a 64bit machine (Octane) you should also do this to ensure
  172. you don't accidently build the libraries as 64bit (which is
  173. untested).
  174. The SGI native compiler support has only been tested on Irix 6.5.
  175. * Building wxMotif on Cygwin
  176. ----------------------------
  177. The normal build instructions should work fine on Cygwin. The one difference
  178. with Cygwin is that when using the "--enable-shared" configure option (which
  179. is the default) the API is exported explicitly using __declspec(dllexport)
  180. rather than all global symbols being available.
  181. This shouldn't make a difference using the library and should be a little
  182. more efficient. However if an export attribute has been missed somewhere you
  183. will see linking errors. If this happens then you can work around the
  184. problem by setting LDFLAGS=-Wl,--export-all-symbols. Please also let us know
  185. about it on the wx-dev mailing list.
  186. * Create your configuration
  187. ---------------------------
  188. Usage:
  189. ./configure [options]
  190. If you want to use system's C and C++ compiler,
  191. set environment variables CXX and CC as
  192. % setenv CC cc
  193. % setenv CXX CC
  194. % ./configure options
  195. to see all the options please use:
  196. ./configure --help
  197. The basic philosophy is that if you want to use different
  198. configurations, like a debug and a release version,
  199. or use the same source tree on different systems,
  200. you have only to change the environment variable OSTYPE.
  201. (Sadly this variable is not set by default on some systems
  202. in some shells - on SGI's for example). So you will have to
  203. set it there. This variable HAS to be set before starting
  204. configure, so that it knows which system it tries to
  205. configure for.
  206. Configure will complain if the system variable OSTYPE has
  207. not been defined. And Make in some circumstances as well...
  208. * General options
  209. -------------------
  210. Given below are the commands to change the default behaviour,
  211. i.e. if it says "--disable-threads" it means that threads
  212. are enabled by default.
  213. Many of the configure options have been thoroughly tested
  214. in wxWidgets snapshot 6, but not yet all (ODBC not).
  215. You have to add --with-motif on platforms, where Motif is
  216. not the default (on Linux, configure will default to GTK).
  217. --with-motif Use either Motif or Lesstif
  218. Configure will look for both.
  219. The following options handle the kind of library you want to build.
  220. --disable-threads Compile without thread support. Threads
  221. support is also required for the
  222. socket code to work.
  223. --disable-shared Do not create shared libraries.
  224. --enable-monolithic Build wxWidgets as single library instead
  225. of as several smaller libraries (which is
  226. the default since wxWidgets 2.5.0).
  227. --disable-optimise Do not optimise the code. Can
  228. sometimes be useful for debugging
  229. and is required on some architectures
  230. such as Sun with gcc 2.8.X which
  231. would otherwise produce segvs.
  232. --enable-profile Add profiling info to the object
  233. files. Currently broken, I think.
  234. --enable-no_rtti Enable compilation without creation of
  235. C++ RTTI information in object files.
  236. This will speed-up compilation and reduce
  237. binary size.
  238. --enable-no_exceptions Enable compilation without creation of
  239. C++ exception information in object files.
  240. This will speed-up compilation and reduce
  241. binary size. Also fewer crashes during the
  242. actual compilation...
  243. --enable-no_deps Enable compilation without creation of
  244. dependency information.
  245. --enable-permissive Enable compilation without checking for strict
  246. ANSI conformance. Useful to prevent the build
  247. dying with errors as soon as you compile with
  248. Solaris' ANSI-defying headers.
  249. --enable-mem_tracing Add built-in memory tracing.
  250. --enable-dmalloc Use the dmalloc memory debugger.
  251. Read more at www.letters.com/dmalloc/
  252. --enable-debug Equivalent to --enable-debug_info plus
  253. --enable-debug-flag.
  254. --enable-debug_info Add debug info to object files and
  255. executables for use with debuggers
  256. such as gdb (or its many frontends).
  257. --enable-debug_flag Define __DEBUG__ and __WXDEBUG__ when
  258. compiling. This enable wxWidgets' very
  259. useful internal debugging tricks (such
  260. as automatically reporting illegal calls)
  261. to work. Note that program and library
  262. must be compiled with the same debug
  263. options.
  264. * Feature Options
  265. -----------------
  266. Many of the configure options have been thoroughly tested
  267. in wxWidgets snapshot 6, but not yet all (ODBC not).
  268. When producing an executable that is linked statically with wxGTK
  269. you'll be surprised at its immense size. This can sometimes be
  270. drastically reduced by removing features from wxWidgets that
  271. are not used in your program. The most relevant such features
  272. are
  273. --without-libpng Disables PNG image format code.
  274. --without-libjpeg Disables JPEG image format code.
  275. --without-odbc Disables ODBC code.
  276. --without-libtiff Disables TIFF image format code.
  277. --without-expat Disable XML classes based on Expat parser.
  278. --disable-threads Disables threads. Will also
  279. disable sockets.
  280. --disable-sockets Disables sockets.
  281. --disable-dnd Disables Drag'n'Drop.
  282. --disable-clipboard Disables Clipboard.
  283. --disable-streams Disables the wxStream classes.
  284. --disable-file Disables the wxFile class.
  285. --disable-textfile Disables the wxTextFile class.
  286. --disable-intl Disables the internationalisation.
  287. --disable-validators Disables validators.
  288. --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
  291. reduction in size.
  292. Please see the output of "./configure --help" for comprehensive list
  293. of all configurable options.
  294. * Compiling
  295. -----------
  296. The following must be done in the base directory (e.g. ~/wxMotif
  297. or ~/wxWin or whatever)
  298. Now the makefiles are created (by configure) and you can compile
  299. the library by typing:
  300. make
  301. make yourself some coffee, as it will take some time. On an old
  302. Pentium 200 around 40 minutes. During compilation, you may get a few
  303. warning messages depending in your compiler.
  304. If you want to be more selective, you can change into a specific
  305. directory and type "make" there.
  306. Then you may install the library and its header files under
  307. /usr/local/include/wx and /usr/local/lib respectively. You
  308. have to log in as root (i.e. run "su" and enter the root
  309. password) and type
  310. make install
  311. You can remove any traces of wxWidgets by typing
  312. make uninstall
  313. If you want to save disk space by removing unnecessary
  314. object-files:
  315. make clean
  316. in the various directories will do the work for you.
  317. * Creating a new Project
  318. ------------------------
  319. 1) The first way uses the installed libraries and header files
  320. automatically using wx-config
  321. g++ myfoo.cpp `wx-config --libs` `wx-config --cxxflags` -o myfoo
  322. Using this way, a make file for the minimal sample would look
  323. like this
  324. CXX = g++
  325. minimal: minimal.o
  326. $(CXX) -o minimal minimal.o `wx-config --libs`
  327. minimal.o: minimal.cpp
  328. $(CXX) `wx-config --cxxflags` -c minimal.cpp -o minimal.o
  329. clean:
  330. rm -f *.o minimal
  331. If your application uses only some of wxWidgets libraries, you can
  332. specify required libraries when running wx-config. For example,
  333. `wx-config --libs=html,core` will only output link command to link
  334. with libraries required by core GUI classes and wxHTML classes. See
  335. the manual for more information on the libraries.
  336. 2) The other way creates a project within the source code
  337. directories of wxWidgets. For this endeavour, you'll need
  338. GNU autoconf version 2.14 and add an entry to your Makefile.in
  339. to the bottom of the configure.in script and run autoconf
  340. and configure before you can type make.
  341. * Further notes by Julian Smart
  342. ---------------------------------
  343. - You may find the following script useful for compiling wxMotif,
  344. especially if installing from zips (which don't preserve file
  345. permissions). Make this script executable with the command
  346. chmod a+x makewxmotif.
  347. -------:x-----Cut here-----:x-----
  348. # makewxmotif
  349. # Sets permissions (in case we extracted wxMotif from zip files)
  350. # and makes wxMotif.
  351. # Call from top-level wxWidgets directory.
  352. # Note that this uses standard (but commonly-used) configure options;
  353. # if you're feeling brave, you may wish to compile with threads:
  354. # if they're not supported by the target platform, they will be disabled
  355. # anyhow
  356. # -- Julian Smart
  357. chmod a+x configure config.sub config.guess
  358. ./configure --with-shared --with-motif --with-debug_flag --with-debug_info --enable-debug --without-threads --without-sockets --without-odbc
  359. make
  360. -------:x-----Cut here-----:x-----
  361. This script will build wxMotif using shared libraries. If you want to build
  362. a static wxWidgets library, use --disable-shared.
  363. Troubleshooting
  364. ---------------
  365. - Solaris compilation with gcc: if the compiler has problems with the variable
  366. argument functions, try putting the gcc fixinclude file paths early in the
  367. include path.
  368. - If you operator-related compile errors or strange memory problems
  369. (for example in deletion of string arrays), set wxUSE_GLOBAL_MEMORY_OPERATORS
  370. and wxUSE_MEMORY_TRACING to 0 in setup.h, and recompile.
  371. - If you get an internal compiler error in gcc, turn off optimisations.
  372. - Problems with XtDestroyWidget crashing in ~wxWindow have been
  373. reported on SGI IRIX 6.4. This has not yet been resolved, so
  374. any advice here would be very welcome. See bugs.txt for a
  375. possible temporary workaround (comment out the final
  376. XtDestroyWidget from ~wxWindow in window.cpp).
  377. - Some compilers, such as Sun C++, may give a lot of warnings about
  378. virtual functions being hidden. Please ignore these, it's correct C++ syntax.
  379. If you find any incorrect instances, though, such as a
  380. missing 'const' in an overridden function, please let us know.
  381. Other Notes
  382. -----------
  383. - Using configure will create a release build of the library by
  384. default: it's recommended to use --enable-debug configure switch
  385. while developing your application. To compile in non-debug mode, use
  386. --disable-debug configure switch.
  387. Bug reports
  388. -----------
  389. Please send bug reports with a description of your environment,
  390. compiler and the error message(s) to the wxwin-developers mailing list at:
  391. wx-dev@lists.wxwidgets.org
  392. Julian Smart, Robert Roebling and Vadim Zeitlin, November 1999.