G

Option Type Default Value #pragma options C C++
-flag - - x x

Purpose
Tells the linkage editor to create a dynamic library. The compiler will automatically export all global symbols from the shared object unless you specify which symbols to export (by using -bE:, -bexport:, -bexpall or -bnoexpall).

If you use -G to create a shared library, the compiler will:

  1. If the user doesn't specify -bE:, -bexport:, -bexpall or -bnoexpall, create an export list containing all global symbols using the CreateExportList script. You can specify another script with the -tE/-B or -qpath=E: options.
  2. If CreateExportList was used to create the export list and -qexpfile was specified, the export list is saved.
  3. Calls the linker with the appropriate options and object files to build a shared object.

This is a linkage editor (ld) option. Refer to AIX Version 4 Commands Reference for a description of ld command usage and synatx.



List of Batch Compiler Options and Their Defaults
Options that Define the Compiler Object Code Produced
Equivalent Batch Compile-Link and Incremental Build Options