shared

Tells the compiler to produce a dynamic shared object instead of an executable.

IDE Equivalent

None

Architectures

IA-32, IntelŪ EM64T, IntelŪ ItaniumŪ architecture

Syntax

Linux: -shared
Windows:  None

Arguments

None

Default

OFF The compiler produces an executable.

Description

This option tells the compiler to produce a dynamic shared object (DSO) instead of an executable.
This includes linking in all libraries dynamically and passing -shared to the linker.

On Itanium-based systems and Intel EM64T systems, you must specify option fpic for the compilation of each object file you want to include in the shared library.

Alternate Options

None

See Also

fpic compiler option

Xlinker compiler option