g, Zi, Z7

Tells the compiler to generate full debugging information in the object file.

IDE Equivalent

Windows: General > Debug Information Format (/Z7, /Zd, /Zi)
Linux: None
Mac OS: None

Architectures

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

Syntax

Linux and Mac OS: -g
Windows:  /Zi
/Z7

Arguments

None

Default

OFF No debugging information is produced in the object file.

Description

This option tells the compiler to generate symbolic debugging information in the object file for use by debuggers.

The compiler does not support the generation of debugging information in assemblable files. If you specify this option, the resulting object file will contain debugging information, but the assemblable file will not.

This option turns off O2 and makes O0 (Linux and Mac OS) or Od (Windows) the default unless O2 (or another O option) is explicitly specified in the same command line.

On IntelŪ EM64T Linux systems and Linux and Mac OS IA-32 systems, specifying the g or O0 option sets the fp option.

For more information on Zi and Z7, see keyword full in debug (Windows*).

Alternate Options

Linux and Mac OS: None
Windows: /debug:full (or /debug)

See Also

Zd compiler option