Activity 28.6.
Compile the library to an object file:
gcc -c -o complexlib.o complexlib.c
-
The
-cflag instructsgccto compile only, without linking and making an executable program. -
The
-oflag allows to specify the name of the output file "complexlib.o".
Note that
complexlib.o is not an executable program (it has no main() for starters). It is simply the translation of our library into machine language.
Try these commands yourself in a Linux terminal. Use the complexlib.c, complexlib.h, and testComplex.c files shown earlier in this chapter, saved together in one folder.

