To compile a shared library:
- Compile your source files into an object file, with no linking. Note that
in the case of compiling a shared library, the -qpic compiler
option is also used. For example:
xlc -qpic -c foo.c
- Use the -qmkshrobj compiler option to create a shared
object from the generated object files. For example:
xlc -qmkshrobj -o libfoo.so foo.o