Compiling a static library
To compile a static library:
- Compile each source file into an object file, with no linking. For example:
xlc -c bar.c example.c
- Use the Linux ar command
to add the generated object files to an archive library file. For example:
ar -rv libfoo.a bar.o example.o