Compiling a shared library

To compile a shared library:

  1. Compile your source files into an object file, with no linking. For example:
    xlc -c foo.c
    
  2. Use the -qmkshrobj compiler option to create a shared object from the generated object files. For example:
    xlc -qmkshrobj -o libfoo.so foo.o