An Introduction to GCC
by Brian J. Gough, foreword by Richard M. Stallman
Paperback (6"x9"), 144 pages. Revised August 2005.
ReviewsThis book has received many positive comments, including a top-rated 5-star review in Linux User and Developer Magazine:
"A wonderfully thorough guide... well-written, seriously usable information" --- Linux User and Developer Magazine (Issue 40, June 2004)
"An excellent introduction... fills a much-needed niche in the marketplace" --- Association of C and C++ Users book review (Issue 16-4, August 2004)
"Answers common questions and provides many useful hints" --- Dr. Gerald Pfeifer (SUSE) -- Technical Editor
About the Book
This manual provides a tutorial introduction to the GNU C and C++ compilers, gcc and g++.
Many books teach the C and C++ languages, this book explains how to use the compiler itself. Based on years of observation of questions posted on mailing lists, it guides the reader straight to the important options of GCC!
Concisely written, with numerous easy-to-follow "Hello World" examples.
Now with extensive new sections on error messages, portability and floating point arithmetic!
Features a special foreword by Richard M. Stallman, principal developer of GCC and founder of the GNU Project.
The technical editor of this book is Dr. Gerald Pfeifer of SUSE (homepage).
You can examine the contents of the printed book here,
- View sample pages (individual pages in image format)
- View sample in PDF (contents and selected pages, 210 kB)
All the money raised from the sale of this book supports the development of free software and documentation.
This book is published under the GNU Free Documentation License.
You can buy the book online at the following bookstores:
- Barnes & Noble.com - USA / International
- The Book Depository.com - USA / International
- Powells.com - USA / International
- Amazon.com - USA / International (note)
- The Book Depository.co.uk - United Kingdom / Europe / International
- Amazon.co.uk - United Kingdom / Europe / International (note)
- Waterstones.com - UK / Europe / International
- Bookzilla.de - Germany / Europe
- Pothi.com - India
The manual can also be ordered from most physical bookstores using the ISBN number.
Note: some bookstore websites may show old bibliographic data in some fields (e.g. old publication date or page count) or old "Search Inside" page images. This is only a problem with the data--all bookstores are physically shipping the latest version of the book.
Print out the following flyer for detailed bookstore and library ordering information,
If the title is listed as "out-of-stock", please ask the bookstore to place an order with one of the wholesale suppliers given in the flyer.
If you encounter any difficulties in obtaining this book, please send an email to firstname.lastname@example.org for assistance.
If you are not completely satisfied with your purchase for any reason we will gladly issue a full refund or replacement (details).
- The CVS manual - Version Management with CVS by Per Cederqvist et al. (ISBN 0-9541617-1-8)
- Comparing and Merging Files with GNU diff and patch by D. MacKenzie, P. Eggert, R. Stallman (ISBN 0-9541617-5-0)
- Valgrind 3.3 - Advanced Debugging and Profiling for GNU/Linux applications by J. Seward, N. Nethercote, J. Weidendorfer et al. (ISBN 0-9546120-5-1)
Subscribe to our RSS feed to stay informed about this and other titles.
For questions about this book, please use our email address email@example.com.
Table of Contents
- Foreword by Richard M. Stallman
- Compiling a C program
- Compilation options
- Using the preprocessor
- Compiling for debugging
- Compiling with optimization
- Compiling a C++ program
- Platform-specific options
- Compiler-related tools
- How the compiler works
- Examining compiled files
- Common error messages
- Getting help
- Further Reading
- Concept Index
- The GNU Profiler Manual - an online copy of the GNU gprof manual
- GNU Binary Utilities Manual - an online copy of the GNU binutils manual
- Source code - for the examples used in the book
For a list of support companies and consultants see the GNU Service Directory
The following companies are involved in the development of GCC itself:
- Ada Core Technologies - support for GNU Ada 95, also supports GNU C for Ada customers
- ACT Europe - division of Ada Core Technologies in Europe
- CodeSourcery - provides GCC development and support to a number of major companies
- How to examine core files - a tutorial
- An Introduction to GCC - interview with the author - Brian Gough (Network Theory Ltd)
- Memory bounds-checking for GCC
- Further reading for "An Introduction to GCC"
ErrataThe following errors in the first version have been corrected in the revised printing of August 2005:
On page 12, regarding the reference to old compilers, the link order of object files was only an issue for libraries, not individual object files. (Thanks to Martin Leisner of Xerox)
On page 38, in an interactive shell the option -DMESSAGE="\"Hello, World!\"" should be typed as -DMESSAGE='"Hello, World!"', to prevent history expansion of !. The version in the book works in a non-interactive shell-script or Makefile. (Thanks to Mario Pernici of INFN)