Skip to main content

Abstract

This chapter’s goal is to get you comfortable with typical GCC usage. It goes behind the scenes and dissects the half-dozen or so GCC command-line options you use by habit. When you invoke GCC to compile a source code file, the compilation process passes through as many as four stages: preprocessing, compilation, assembly, and linking. You will learn in this chapter how to stop the compilation process at any one of these stages. GCC also accepts many additional options that control the behavior of the preprocessor, the linker, and the assembler, so this chapter shows you the ins and outs of these magic GCC incantations, too. Other options discussed in this chapter allow you to modify the directory search path GCC uses when it runs and also enable you to exercise greater control over the content format of GCC’s diagnostic messages. You will also learn how to tell GCC which dialect of C, such as strict ANSI/ISO C or good ole Kernighan and Ritchie (K&R) C, it should expect. Finally, you will learn a variety of command-line options you can use when compiling C++ code.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Kurt Wall and William von Hagen

About this chapter

Cite this chapter

Wall, K., Von Hagen, W. (2004). Basic GCC Usage. In: The Definitive Guide to GCC. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-0704-7_3

Download citation

  • DOI: https://doi.org/10.1007/978-1-4302-0704-7_3

  • Publisher Name: Apress, Berkeley, CA

  • Print ISBN: 978-1-59059-109-3

  • Online ISBN: 978-1-4302-0704-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics