ar Command

For a full description of the ar command, refer to the AIX Version 4 Commands Reference.

Options

-X32 Work with object files compiled for 32-bit usage. If the OBJECT_MODE environment variable is not set otherwise, this is the default mode.
-X64 Work with object files compiled for 64-bit usage.
-X32_64 Work with object files compiled for either 64- or 32-bit usage. The ar program examines each object file to determine its mode.
m Moves the named files to some other position in the library archive
r Replaces a named file if it already appears in the library archive
ar_options Other ar command options. Refer to the AIX Version 4 Commands Reference for more information.
archive_file.a Name of the library archive file to be produced
nonshared_file Name of a nonshared object file
shared_file Name of a shared file created with the makeC++SharedLib command

Example
To prepare a file priority_lib.a with shared libraries sharedlib450.o and sharedlib200.o and nonshared file fileUV.o all at different priorities, enter the command:

ar rv prio_lib.a fileUV.o sharedlib450.o sharedlib200.o

where:

rv Are two ar options: r replaces a named file if it already appears in the library, and v writes to standard output a verbose file-by-file description of the making of the new library
prio_lib.a Name for the new library archive file that will contain the shared and nonshared library files and their priority levels
fileUV.o Name of a nonshared file
sharedlib450.o Name of an object file (prepared with the makeC++SharedLib program) that holds shared object files and their priority levels
sharedlib200.o Name of an object file (prepared with the makeC++SharedLib program) that holds other shared object files and their priority levels


Overview of Shared Library Initialization
Constructing a Library


Setting Up the Compilation Environment


makeC++SharedLib Command