home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / os2 / programm / 4401 < prev    next >
Encoding:
Internet Message Format  |  1992-08-23  |  27.0 KB

  1. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!mips!swrinde!elroy.jpl.nasa.gov!nntp-server.caltech.edu!brooke
  2. From: brooke@cco.caltech.edu (Brooke Paul Anderson)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Latest manual for getting/installing/using EMX port of GNU C/C++
  5. Message-ID: <1992Aug24.012726.10834@cco.caltech.edu>
  6. Date: 24 Aug 92 01:27:26 GMT
  7. Sender: news@cco.caltech.edu
  8. Organization: California Institute of Technology, Pasadena
  9. Lines: 604
  10. Nntp-Posting-Host: sandman
  11.  
  12.  
  13. A USER'S MANUAL FOR THE FREE GNU C AND C++ SOFTWARE-DEVELOPMENT
  14. SYSTEM FOR OS/2 V2.0
  15.  
  16. by Brooke P. Anderson, 8/23/92
  17.  
  18. Brooke Anderson
  19. 1155 E. Del Mar #312
  20. Pasadena, CA  91106
  21. USA
  22. Phone:  (818) 577-7555
  23. GEnie:  BROOKE
  24. Internet:  brooke@hope.caltech.edu
  25.  
  26. TABLE OF CONTENTS
  27.  
  28. 1.0 Introduction
  29. 2.0 How to get it
  30. 3.0 How to install it
  31.      3.1 Zoo and uz42_16e.zoo
  32.      3.2 Wholeinf.zoo
  33.      3.3 Gnumk362.zoo
  34.      3.4 Gnudev.zoo and emxdev.zoo
  35.      3.5 Emxgdb.zoo and emxgpp.zoo
  36.      3.6 The final steps
  37. 4.0 How to use it
  38.      4.1 Using info
  39.      4.2 Using the compiler
  40.      4.3 Using the debugger
  41.      4.4 Using make
  42. 5.0 Where to get more information
  43. 6.0 Conclusions
  44.  
  45. Appendix 1:  Optional packages
  46. Appendix 2:  Frequently asked questions
  47. Appendix 3:  Sources of distribution
  48.  
  49. 1.0 INTRODUCTION
  50.  
  51. This document describes a free GNU C and C++ software-development
  52. system for OS/2 v2.0.  It tells you how to acquire all the
  53. necessary software, how to install it, how to start using it, and
  54. where to look for more information.
  55.  
  56. The GNU software-development system includes a C and C++
  57. compiler, a debugger, an assembler, a make utility (for
  58. automating the compilation of programs made of many source
  59. files), and a hypertext reader (for reading the documentation). 
  60. The compiler generates full 32-bit, optimized code, and it
  61. supports many OS/2 API calls, so you software developers out
  62. there can use it for PM programming, manipulating semaphores,
  63. manipulating threads, using named pipes, etc.  Optional packages
  64. include emacs (a programmer's editor), a package for using IBM's
  65. OS/2 tool kit, and full source code for all the programs and
  66. libraries in the system.
  67.  
  68. GNU software is originally developed by the Free Software
  69. Foundation, an organization which produces a lot of free software
  70. for UNIX.  After the Free Software Foundation releases the UNIX
  71. versions, people often port them to many other operation systems
  72. (such as OS/2).  Despite the fact that the software is free, the
  73. UNIX community considers it a standard and often prefers it over
  74. other products because of its high quality.  The compilers, for
  75. example, produce well-optimized code; and emacs is one of the two
  76. most popular editors for UNIX.
  77.  
  78. Sometimes, there is more than one port of a GNU program.  For
  79. OS/2, for example, there are two different ports of the GNU C
  80. compiler (called "gcc").  This document discusses only one of
  81. them (the EMX port) since the EMX port provides faster floating
  82. point routines and since it works with a debugger.  Another
  83. difference is that the EMX port produces UNIX-style object files
  84. and uses the GNU linker whereas the other port produces
  85. OS/2-style object files and uses link386.  Hopefully, a future
  86. version of the EMX port will handle OS/2-style object files. 
  87. People frequently produce new versions of and enhancements for
  88. the GNU software and the ports based on it.
  89.  
  90. IMPORTANT:  Not all of the archives described in this document
  91. extract correctly onto FAT file systems, file systems which are
  92. still strangled by the egregious 8.3 file-naming convention.  If
  93. you are still using FAT, you will have to work around some
  94. problems.  For example, the wholeinf.zoo archive, described
  95. below, will not extract or operate properly on FAT.  I think
  96. everything else is FAT compatible, but I haven't checked.  I
  97. recommend that you allocate at least part of your file system for
  98. HPFS and thus leave behind another of the many grim limitations
  99. of MS-DOS.  
  100.  
  101. 2.0 HOW TO GET IT
  102.  
  103. The full software-development system (and the various optional
  104. packages described in Appendix 1) are available from a variety of
  105. sources.  If you have access to Internet, you can get the files
  106. from anonymous-ftp sites.  In the USA, the main anonymous-ftp
  107. site for OS/2 is ftp-os2.nmsu.edu.  In Germany, the main
  108. anonymous-ftp site for OS/2 is rusinfo.rus.uni-stuttgart.de.  The
  109. files are also available on GEnie, and they might be available on
  110. CompuServe and many other on-line services.  Also, see Appendix 3
  111. for a list of people who are willing to distribute the whole
  112. system through regular mail.
  113.  
  114. You need to obtain the files "gnudev.zoo" (which contains the
  115. compiler and some auxiliary programs), "emxdev.zoo" (which
  116. contains more auxiliary programs), "emxgpp.zoo" (which contains
  117. the libraries the compiler needs for C++ programs), "emxgdb.zoo"
  118. (which contains the latest port of the debugger), "gnumk362.zoo"
  119. (which contains make), and "wholeinf.zoo" (which contains the
  120. hypertext reader and all the documentation for the compiler, the
  121. debugger, and make).  See Appendix 1 for a description of what
  122. you need for the optional packages.  By the way, this file is in
  123. the archive "gnustart.zoo" (in case you need to tell someone how
  124. to find it).
  125.  
  126. The above files might be available as ZIP archives instead of ZOO
  127. archives, but that is not a problem as both zip and zoo are
  128. available free for OS/2.  You can get them from the same place
  129. you get the other archives.  You need the file "uz42_16e.zoo"
  130. (which contains unzip).  You also need either "zoo210e.exe"
  131. (which is a self-extracting archive that contains zoo) or both
  132. "zoo210.zoo" (which contains zoo) and "booz.exe" (which contains
  133. a small unZOO program for unarchiving zoo210.zoo).
  134.  
  135. The sizes of the various files are as follows:  zoo210e.exe
  136. (120k), booz.exe (26k), zoo210.zoo (69k), uz42_16e.zoo (84k),
  137. gnumk362.zoo (259k), gnudev.zoo (846k), emxdev.zoo (227k),
  138. emxgdb.zoo (251k), emxgpp.zoo (1232k), and wholeinf.zoo (564k).
  139.  
  140. On GEnie, all the archives are (or soon will be) in the OS/2
  141. library (library 13) of the IBMPC round table.  On
  142. ftp-os2.nmsu.edu, zoo210e.exe and uz42_16e.zoo are in
  143. pub/os2/all/archivers; gnumk362.zoo is in
  144. pub/os2/2.0/programming; wholeinf.zoo and gnustart.zoo are
  145. currently in pub/downloads (but will be moving elsewhere shortly,
  146. maybe to directories with the word "info" in them); and the rest
  147. of the files are in pub/os2/2.0/programming/emx-0.8d.  On
  148. rusinfo.rus.uni-stuttgart.de, check in pub/os2/emx-0.8d and other
  149. likely directories (such as those called "gnu").
  150.  
  151. 3.0 HOW TO INSTALL IT
  152.  
  153. The following subsections describe how to install the various
  154. pieces of the GNU C and C++ software-development system.  Go
  155. through the procedures step by step as described -- the order is
  156. important.  Don't feel compelled to read through any of the
  157. readme files or other documentation spit out during the
  158. unarchiving process -- I think you will have a much easier time
  159. if you go through this document beforehand.
  160.  
  161. 3.1 ZOO AND UZ42_16E.ZOO
  162.  
  163. If you don't already have zoo and unzip, you will need to install
  164. them.  The next paragraph describes the installation procedure
  165. for zoo210e.exe; the one after that describes the procedure if
  166. you instead have booz.exe and zoo210.zoo; and the last paragraph
  167. describes the procedure for installing unzip.
  168.  
  169. zoo210e.exe is a self-extracting archive.  Simply move it to a
  170. convenient directory and type "zoo210e".  Add the name of the
  171. directory zoo is in to the path variable in your config.sys file,
  172. and reboot.  (On my machine, zoo.exe is in c:\apps\zoo, so I
  173. appended "c:\apps\zoo;" to the "SET PATH" statement in
  174. config.sys.)
  175.  
  176. If you have booz.exe and zoo210.zoo instead of zoo210e.exe,
  177. simply move booz.exe and zoo210.zoo to a convenient directory and
  178. type "booz x zoo210".  Then alter config.sys as described in the
  179. previous paragraph, and reboot.
  180.  
  181. To unarchive uz42_16e.zoo, you simply move it to another
  182. convenient directory and type "zoo e uz42_16e".  Add the name of
  183. the directory unzip is in to your path as well, and again reboot. 
  184.  
  185. Now, you can unarchive any ZOO archive by typing "zoo e
  186. filename", and you can unarchive any ZIP archive by typing "unzip
  187. filename", where "filename.zoo" or "filename.zip" is the name of
  188. the archive.
  189.  
  190. 3.2 WHOLEINF.ZOO
  191.  
  192. Copy wholeinf.zoo to any convenient directory and unarchive it. 
  193. It will disgorge a program called "info.exe" (the hypertext
  194. reader), several auxiliary files, and a bunch of documentation
  195. files for itself, the compiler, the debugger, and make.
  196.  
  197. 3.3 GNUMK362.ZOO
  198.  
  199. Copy gnumk362.zoo to any convenient directory and unarchive it. 
  200. The archive will disgorge several files, including two more
  201. archives:  source.zoo and info.zoo.  You can delete info.zoo, as
  202. its contents are duplicated in wholeinf.zoo.  You can keep
  203. source.zoo if you want the source code to make, but it is not
  204. necessary to keep it.
  205.  
  206. Add the name of the directory make is in to your path statement
  207. in config.sys.  (I have make in c:\apps\make, so I appended
  208. "c:\apps\make;" to the "SET PATH" statement in my config.sys.)
  209.  
  210. 3.4 GNUDEV.ZOO AND EMXDEV.ZOO
  211.  
  212. These archives create the directory ".\emx" and a bunch of
  213. directories under that.  Thus, unarchive the files from the
  214. directory in which you want this emx directory.  (In other words,
  215. if you unarchive gnudev.zoo in the directory "\apps", the process
  216. will create \apps\emx, \apps\emx\bin, \apps\emx\lib, and many
  217. other such directories.)
  218.  
  219. 3.5 EMXGDB.ZOO AND EMXGPP.ZOO
  220.  
  221. As with the above two archives, unarchive emxgdb.zoo and
  222. emxgpp.zoo in the directory on top of the emx directory.  In
  223. other words, if the emx directory is \apps\emx, move emxgdp.zoo
  224. and emxgpp.zoo to \apps and unarchive them.
  225.  
  226. IMPORTANT:  These two archives contain newer versions of some of
  227. the files contained in gnudev.zoo and emxdev.zoo.  If zoo or
  228. unzip ask you if you want to replace existing files (i.e.,
  229. overwrite files already on disk), answer "yes".  Make sure that
  230. you do not skip the unarchiving of any files in emxgdb.zoo and
  231. emxgpp.zoo.
  232.  
  233. 3.6 THE FINAL STEPS
  234.  
  235. Now, you need to modify your config.sys file.  The examples below
  236. are from my config.sys file, and I have the emx directory
  237. installed under c:\apps.  Thus, my system has the directories
  238. "c:\apps\emx\dll", "c:\apps\emx\lib", "c:\apps\emx\include",
  239. "c:\apps\emx\bin", and so on -- you will need to modify the
  240. following examples so that the directories are specified
  241. correctly.  
  242.  
  243. First, you need to specify in your libpath the location of
  244. emx.dll.  In my config.sys, I have
  245.  
  246. LIBPATH=.;C:\OS2\DLL;C:\OS2\MDOS;C:\;C:\OS2\APPS\DLL;c:\apps\emx\dll;
  247.  
  248. Second, add the name of the emx\bin directory to your path
  249. statement in config.sys.  (I appended "c:\apps\emx\bin;" to the
  250. "SET PATH" statement in my config.sys.)
  251.  
  252. Third, you need to set a few environmental variables so that the
  253. compiler knows where to find various files:
  254.  
  255. set C_INCLUDE_PATH=c:/apps/emx/include
  256. set LIBRARY_PATH=c:/apps/emx/lib
  257. set CPLUS_INCLUDE_PATH=C:/apps/emx/include.cpp;C:/apps/emx/include
  258.  
  259. IMPORTANT:  you need to use forward slashes ("/") and not
  260. backward slashes ("\") in the previous three lines.  Do NOT use
  261. forward slashes in your libpath statement.
  262.  
  263. Now, reboot your machine so that these definitions take effect. 
  264. Then go into the emx\lib\misc directory and type "make", and
  265. finally go into the emx\lib\math directory and type "make". 
  266. These last two actions update some libraries, and you must make
  267. sure you rebooted the machine once before executing the make
  268. commands.
  269.  
  270. This completes the installation process.
  271.  
  272. 4.0 HOW TO USE IT
  273.  
  274. Now, you are ready to use info (the hypertext reader), to compile
  275. programs, to debug programs, and to use make.  The next
  276. subsections discuss each of these actions in turn.
  277.  
  278. 4.1 USING INFO
  279.  
  280. Go into the directory in which info.exe resides.  Type "info". 
  281. You are now looking at a screen that has some information on the
  282. top half (information such as "Typing 'd' returns here, 'q'
  283. quits, '?' lists all info commands, 'h' gives a primer for
  284. first-timers . . .") and a list of subjects near the bottom
  285. (subjects such as "Info", "Gcc", "Gdb", "Make", "Gdbint", and
  286. "Cpp".).  
  287.  
  288. Go ahead and type "h" for a tutorial.  The most basic functions
  289. to remember are:  type "q" to quit, type "?" to get a list of
  290. commands, hit the space bar or PgDn key to go down a page, press
  291. the Del key or the PgUp key to go up a page, press "n" to go to
  292. the next node (think of a node as being a collection of one or
  293. more pages dealing with a single topic), press "p" to go to the
  294. previous node, use the up and down arrow keys to highlight
  295. choices of new nodes to jump to, and press enter to jump to the
  296. highlighted node.
  297.  
  298. Just play around with it a little while, and you will get the
  299. hang of it.  Type "d" to get back to the main directory, use the
  300. down arrow to highlight "Gcc", press enter, press the down arrow
  301. to highlight "Contributors", press enter, scan through the pages
  302. of text by hitting the PgDn key a couple of times, type "?" to
  303. see a list of commands, type "p" a couple of times, etc.
  304.  
  305. You can also read the info files with emacs.  See Appendix 1 for
  306. details.
  307.  
  308. 4.2 USING THE COMPILER
  309.  
  310. To compile a C source file called "myprog.c", type "gcc -o
  311. myprog.exe myprog.c".  The -o switch tells gcc that it should
  312. call the resulting executable "myprog.exe".  To compile the C++
  313. source file "myprog.cc", type "gcc -o myprog.exe myprog.cc
  314. -lgpp".  C++ source files should have the extension ".cc".  The
  315. -lgpp switch tells gcc to link the C++ libraries.  You can also
  316. tell gcc to optimize your code by using the -O switch.  There are
  317. two levels of optimization (-O and -O2, the highest being -O2). 
  318. Thus, for the fastest-executing code (at the expense of time to
  319. compile and of size of the executable), you would type "gcc -O2
  320. -o myprog.exe myprog.c" for myprog.c and "gcc -O2 -o myprog.exe
  321. myprog.cc -lgpp" for myprog.cc.
  322.  
  323. Note:  Specifying "-o myprog.exe" is important.  If you don't
  324. specify ".exe" as the suffix of the output file name, the
  325. compiler will generate a UNIX-style executable which will not run
  326. under OS/2 even if you subsequently rename the file so that it
  327. has a .exe extension.
  328.  
  329. 4.3 USING THE DEBUGGER
  330.  
  331. To debug a program, you need to compile it with the -g switch: 
  332. "gcc -g -o myprog.exe myprog.c" for myprog.c and likewise for
  333. myprog.cc.  After compiling, you then type "gdb myprog.exe" to
  334. start the debugger.  Type "h" at the debugger prompt to get a
  335. list of help topics.  gdb supports all sorts of breakpoints
  336. (including conditional ones), and you can watch variables, set
  337. variables to different values, etc.  For example, to get help on
  338. running programs from within the gdb, you can type "help
  339. running".  That will give you a list of commands such as run,
  340. kill, step, etc.  You can get help on individual commands by
  341. typing, for example, "help step".
  342.  
  343. The following is a sample compile and debug session.  Go into the
  344. emx\test directory and type "gcc -g -o hello.exe hello.cc -lgpp"
  345. to compile hello.cc.  Type "hello" to run it, to see if the
  346. compiler is functioning.  The program will print "Hello, world!"
  347. on the screen.  Now type "gdb hello.exe" to start gdb.  At the
  348. prompt "(gdb)", type "list main" to list the function "main". 
  349. Then type "break 5" to cause execution to stop at line 5 in the
  350. main function.  Type "run" to start execution -- it will stop at
  351. line 5.  Type "print argc" to see the value of the variable
  352. "argc".  Type "step" to run line 5 then halt execution at the
  353. next line.  Type "quit" to quit.  To list a function (main(),
  354. say) that is longer than a screenful, type "list main"; then type
  355. "list" again to list the next screenful of main.
  356.  
  357. You can run the debugger interactively from within emacs, too. 
  358. This arrangement provides a more visual system similar to
  359. MicroSoft's CodeView or Borland's Integrated Development
  360. Environment.  See Appendix 1 for details.
  361.  
  362. 4.4 USING MAKE
  363.  
  364. Assume you have a program made of the following source files: 
  365. "myprog1.c" and "myprog2.c".  You might manually compile these
  366. files by typing "gcc -o myprog.exe myprog1.c myprog2.c".  Of
  367. course, if you change only one of the files, typing such a
  368. command causes the recompiling of both source files.  During
  369. development, this could be tiresome if the files take a long time
  370. to compile.  A better way would be to type "gcc -c myprog1.c"
  371. which compiles myprog1.c into the object file "myprog1.o" (the -c
  372. switch tells gcc to make an object file), then to type "gcc -c
  373. myprog2.c" to generate myprog2.o, and finally to type "gcc -o
  374. myprog.exe myprog1.o myprog2.o".  This way, if you change only
  375. myprog1.c, you can recompile it and relink it with myprog2.o to
  376. create myprog.exe (skipping the "gcc -c myprog2.c" step).  This
  377. will be much faster if the source files take a long time to
  378. compile (or if you have a lot of source files).
  379.  
  380. Of course, doing all this typing is tiresome, too.  Also, if
  381. myprog1.c happens to depend on myprog1.h, and you change
  382. myprog1.h, you must recompile myprog1.c.  Thus, you have to keep
  383. track of all the file dependencies in order to know, after
  384. changing one header file, which other files need to be
  385. recompiled.
  386.  
  387. Fortunately, make takes care of all of this automatically.  All
  388. you have to do is create one text file that describes the various
  389. dependencies and the various steps to compile the program.  You
  390. name the text file "Makefile".  From then on, whenever you type
  391. "make", make examines the Makefile, looks for files which have
  392. changed since the last compile, recompiles any files which depend
  393. on the changed files, and relinks everything into a new
  394. executable.
  395.  
  396. For example, suppose that myprog.exe is made from myprog1.c and
  397. myprog2.c, that myprog1.c contains the lines "#include
  398. "myprog1.c"" and "#include "mainhead.h"", and that myprog2.c
  399. includes myprog2.h and mainhead.h.  The Makefile describing all
  400. of this is
  401.  
  402. myprog.exe: myprog1.o myprog2.o
  403.      gcc -o myprog.exe myprog1.o myprog2.o
  404.  
  405. myprog1.o: myprog1.c myprog1.h mainhead.h
  406.      gcc -c myprog1.c
  407.  
  408. myprog2.o: myprog2.c myprog2.h mainhead.h
  409.      gcc -c myprog2.c
  410.  
  411. The first line shows that myprog.exe depends on myprog1.o and
  412. myprog2.o.  If either of those has changed since the last time
  413. make was invoked, make will relink them to create myprog.exe by
  414. giving the command under the first line.  The fourth line shows
  415. that myprog1.o depends on myprog1.c, myprog1.h, and mainhead.h. 
  416. If any of these three files have changed since the last time make
  417. was run, make will recompile myprog1.o by issuing the command on
  418. line five.  It will also realize that myprog.o has changed, that
  419. myprog.exe depends on myprog.o, and will relink myprog.exe.  If
  420. mainhead.h is changed, make will recompile and relink everything
  421. since myprog1.o needs to be changed, myprog2.o needs to be
  422. changed, and thus myprog.exe needs to be changed.
  423.  
  424. The example above shows the general form of a Makefile.  You give
  425. a target (like "myprog.exe" or "myprog1.o") followed by a colon,
  426. followed by a space, followed by a space-delimited list of files
  427. the target depends on.  The next line specifies the action to be
  428. taken when any of the dependencies change:  the first character
  429. MUST be a tab (not just a bunch of spaces used for indentation);
  430. then you type the command make should issue.  A Makefile is just
  431. a list of such targets, dependencies, and actions.
  432.  
  433. 5.0 WHERE TO GET MORE INFORMATION
  434.  
  435. Unfortunately, the GNU C and C++ software-development system does
  436. not come with extensive, easy-to-use documentation like that you
  437. would get with, for example, Borland C++.  The info files (the
  438. ones you see when you use the hypertext reader) do not contain
  439. information on all the usual C library functions (like printf(),
  440. calloc(), fopen(), sin(), etc.).  develop.doc (in the emx\doc
  441. directory) does contain a partial list of library functions,
  442. including a list of headers you need to include, what the
  443. functions do, and what parameters they accept -- but it is not
  444. complete.  Moreover, some of the installation instructions are
  445. sketchy (which is why I wrote this document).
  446.  
  447. However, as mentioned previously, people frequently update this
  448. software (the original GNU software and the ports based on it),
  449. producing new versions and enhancements.  Thus, the documentation
  450. might be improved in the future.
  451.  
  452. Also, since the C compiler is ANSI C compliant (or at least close
  453. to it) and since the C++ compiler is very close to AT&T C++ 2.0,
  454. you can use just about any ANSI C and AT&T C++ 2.0 reference
  455. manuals.  I use the ones I got with an old version of Borland
  456. Turbo C++.  If you don't have such manuals, you should be able to
  457. find something suitable in a bookstore.  
  458.  
  459. Keep in mind that, even if you already have books on C and C++,
  460. you need an ANSI C language reference manual that contains a
  461. complete list of all the functions available in ANSI C (like
  462. printf(), calloc(), sin(), time(), etc.) including descriptions
  463. of the prototypes for the functions (like "double sin(double)"
  464. and "time_t time(time_t *)") and descriptions of which headers
  465. you need to include in order to use the functions (sin() requires
  466. math.h, and time() requires time.h, for example).  I recommend C: 
  467. A Reference Manual, by S. P. Harbison and G. L. Steele, Jr.
  468. (Prentice-Hall, 1991).  This book contains all the necessary
  469. information on library functions.
  470.  
  471. For those of you developing applications that use the PM or that
  472. use special OS/2 functions, the system DOES support many of the
  473. OS/2 API functions, including ones for semaphores, PM
  474. programming, named pipes, threads, etc.  See develop.doc (in the
  475. emx\doc directory) for a list of the supported functions.  (Also,
  476. see Appendix 1 for information on an optional package that
  477. enables you to use the full IBM OS/2 2.0 tool kit.)  The
  478. documentation does not contain a manual on how to use these API
  479. calls -- you need an OS/2 programming book for that.  For
  480. information on programming the PM, take a look at OS/2 2.0
  481. Presentation Manager GPI:  A Programming Guide to Text, Graphics,
  482. and Printing, by G. C. E. Winn (Van Norstrand-Reinhold, 1992); or
  483. Learning to Program OS/2 2.0 Presentation Manager by Example: 
  484. Putting the Pieces Together, by Stephen Knight (Van
  485. Norstrand-Reinhold, 1992).  [I  will add more titles when I find
  486. out more information.  Does anyone have recommendations for books
  487. on the OS/2 API in general, not just the PM?]
  488.  
  489. Also, way back when you were unarchiving, you might have been
  490. itching to examine the various readme files and other
  491. documentation.  Now is the time to do that to your heart's
  492. content.  Browse through readme.gpp and readme.gdb (both in the
  493. emx directory); readme.doc, install.doc, user.doc, and
  494. develop.doc (all in the emx/doc directory); and the information
  495. available from the hypertext reader.
  496.  
  497. 6.0 CONCLUSIONS
  498.  
  499. I wrote this to help people get started with a free -- yet
  500. powerful -- 32-bit C and C++ software-development system for
  501. OS/2.  For the price of a couple of books, you have a full C and
  502. C++ programming system.  For the additional price of an OS/2
  503. programming book, you have a bargain-basement SDK.
  504.  
  505. If you find errors in this document, or if you have suggestions
  506. for its improvement, please let me know.  My GEnie address is
  507. "BROOKE", and my Internet address is "brooke@hope.caltech.edu".
  508.  
  509. APPENDIX 1:  OPTIONAL PACKAGES
  510.  
  511. There are a few optional packages you can get for this
  512. software-development system, packages which are not necessary but
  513. which can nevertheless be important.
  514.  
  515. The first is emacs, the GNU programmer's editor.  As mentioned
  516. earlier, this is one of the two most popular editors for UNIX,
  517. and it is very popular on many other operating systems as well. 
  518. An interesting feature of GNU emacs is that you can use it to
  519. interact both with the info files (the ones used by the hypertext
  520. reader) and with the debugger.  This latter ability provides
  521. fully-interactive debugging, similar to what MicroSoft's CodeView
  522. or Borland's Integrated Development Environment offers.  To use
  523. emacs, you need the files "emacs.doc" and "emacsbin.zoo" (or a
  524. collection of smaller archives).  The source code is available in
  525. "emacssrc.zoo" and "emacspat.zoo".  On ftp-os2.nmsu.edu, these
  526. files are available in pub/os2/2.0/gnu/emacs.
  527.  
  528. The second is a package that allows you to use IBM's OS/2 tool
  529. kit.  You still have to buy the tool kit from IBM, but it is
  530. probably cheaper than buying their entire software-development
  531. kit.  With this package and IBM's tool kit, you have full use of
  532. all OS/2 API functions.  This package is available in the file
  533. "icc2gcc.zoo".  On ftp-os2.nmsu.edu, this file is available in
  534. pub/os2/2.0/programming/emx-0.8d.
  535.  
  536. The third package contains full source code to all the programs
  537. and libraries that come with the software-development system. 
  538. The source (and the full collection of auxiliary programs) for
  539. the hypertext reader is in the file "gnuinfo.zoo", available on
  540. ftp-os2.nmsu.edu in the pub/os2/2.0/gnu directory.  The source
  541. for make comes in gnumk362.zoo, and the names of the archives for
  542. all the other sources in the system are given in readme.doc. 
  543. (readme.doc is in the emx\doc directory.)  The latter archives
  544. are available on ftp-os2.nmsu.edu in
  545. pub/os2/2.0/programming/emx-0.8d and on
  546. rusinfo.rus.uni-stuttgart.de in pub/os2/emx-0.8d.  The source
  547. code to the libraries is available on GEnie.
  548.  
  549. APPENDIX 2:  FREQUENTLY ASKED QUESTIONS
  550.  
  551. This is such a common question concerning gcc (the compiler) that
  552. I figured I should answer it from the start:  "What's wrong with
  553. printf()?"  People find that printf() doesn't immediately echo to
  554. the screen; the string is held in a buffer and dumped later,
  555. usually long after the printf() statement is executed.  This is
  556. not really a bug -- ANSI C does not specify that printf() should
  557. flush the I/O buffer (since it is probably more efficient on
  558. mainframe systems with terminals to flush the I/O buffer only by
  559. large chunks at a time).  So, to get a printf() to work like you
  560. are probably accustomed, put an fflush(stdout) after any printf()
  561. you want immediately displayed.
  562.  
  563. APPENDIX 3:  SOURCES OF DISTRIBUTION
  564.  
  565. This document already described some places from which you can
  566. get the necessary archives:  ftp-os2.nmsu.edu,
  567. rusinfo.rus.uni-stuttgart.de, GEnie, and perhaps CompuServe and
  568. other on-line services.  However, some people don't have access
  569. to these sites, don't have modems fast enough to download
  570. megabytes of data in a reasonable amount of time, or can't afford
  571. the charges which they might incur by downloading from on-line
  572. services.  For these people, I am including the following list of
  573. people willing to distribute the whole system through regular
  574. mail.  Keep in mind that people might change their prices, cease
  575. distributing the software, move, etc., so contact them first to
  576. get current details.
  577.  
  578. Brooke Anderson
  579. 1155 E. Del Mar #312
  580. Pasadena, CA  91106
  581. USA
  582. Phone:  (818) 577-7555
  583. GEnie:  BROOKE
  584. Internet:  brooke@hope.caltech.edu
  585. Cost:  $18 in US; in other countries, disks + shipping + $5
  586.  
  587. Juergen Egeling
  588. Werderstr. 41
  589. 7500 Karlsruhe
  590. Germany
  591. Phone:  0721-373842
  592. FAX:  0721-373842
  593. BITNET:  ry90@dkauni2
  594. Internet:  ry90@ibm3090.rz.uni-karlsruhe.dbp.de
  595. X.400:  S=ry90;OU=ibm3090;OU=rz;P=uni-karlsruhe;A=dbp;C=de
  596. Cost:  disks + shipping + DM 25
  597.  
  598. Doug Robison
  599. 1311 Webster
  600. Chillicothe, MO  64601
  601. USA
  602. Phone:  (816) 646-1085
  603. GEnie:  D.ROBISON
  604. Cost:  disks + shipping + $5
  605.  
  606. If you would like to get on this list and if you have access to
  607. Internet or an on-line service, just send me your name, a
  608. description of how people can contact you (including your e-mail
  609. address), and how much money you want for the job (such as "$20",
  610. "disks + shipping + $30", or whatever you want to charge).  It
  611. would be helpful to have a list that includes people in various
  612. countries.
  613.  
  614.  
  615.                              The End 
  616.