Separate compilation

[Image unavailable]

The steps taken in creating the executable program can be divided up in to two compiler/assembler steps circled in red, and one final linker step circled in yellow. The two .o files may be created separately, but both are required at the last step to create the executable program.

You can use the -c option with cc to create the corresponding object (.o) file from a .c file. For example, typing the command: cc -c green.c will not produce an a.out file, but the compiler will stop after the assembler stage, leaving you with a green.o file.


PreviousNextIndex

Last updated on Wednesday, June 21, 1995 by Ben Y. Yoshino
Copyright © 1995 University of Hawai`i, College of Engineering, Computer Facility
All rights reserved.