A GNU/Unix development environment primer

g++, make, and gdb

This was originally written by Carl Burch for sections A and B of 15-211 (Fundamental structures of computer science I) at Carnegie Mellon University in Spring 1996. A PostScript version is also available.

This primer presents the most useful aspects of using gcc/g++, make, and gdb in developing software. These utilities are not only extremely useful but also packed with features; this introduction almost completely exhausts the features that the author finds useful. These three programs constitute the most important elements of the GNU/Unix development environment.

This document contains three sections:

The GNU project strives to produce a complete, freely available operating system. Though GNU stands for GNU's Not Unix, its development environment is in most respects identical to that of Unix, reflecting the Unix background of many of its programmers. In fact, nearly all of what this introduction covers about g++ (the GNU C++ compiler) will apply also to gcc (the GNU C compiler) and cc (the Unix C compiler). Likewise, the behavior of the Unix debugger dbx is very similar to, though much less sophisticated than, the GNU debugger gdb. (Since local machines do not use the GNU make, we will cover the Unix version.)

In future programming projects you will likely find yourself using the GNU/Unix development environment. It is recommended, therefore, (but not required) that you become familiar with it now so that in later, bigger projects you are not hindered in learning a new development environment.

With practice, you will find the development environment convenient - even enjoyable - and you will come to understand why Unix is considered such a good operating system for software developers.

When you find yourself wanting to know about g++, make, or gdb, you will find the on-line man pages extensive and exhaustive (and perhaps exhausting).

Learning how to use g++, make, and gdb right can render the development process quicker, more effective, and more bearable. Of course nothing exists yet to make the development process trivial - but this is what makes programming fun. If you know how to wield it well, the GNU/Unix development environment will contribute to your programming experiences.

Last updated 16 Feb 1996.