Intel® C++ Compiler XE 13.1 User and Reference Guides

g, Zi, Z7

Tells the compiler to generate full debugging information in the object file or a project database (PDB) file.

IDE Equivalent

Windows: General > Debug Information Format

Linux: General > Include Debug Information

OS X: General > Generate Debug Information

Architectures

All

Syntax

Linux and OS X:

-g

Windows:

/Zi

/Z7

Arguments

None

Default

OFF

No debugging information is produced in the object file or in a PDB file.

Description

Options -g (Linux* OS and OS X*) and /Z7 (Windows* OS) tell the compiler to generate symbolic debugging information in the object file, which increases the size of the object file. The /Zi option (Windows OS) tells the compiler to generate symbolic debugging information in a PDB file.

If you want to name the file, use option /Fd; otherwise, the PDB file used by the compilation step will be named vc90.pdb in Microsoft Visual Studio* 2008, and vc100.pdb in Microsoft Visual Studio* 2010. Note that Microsoft Visual Studio users do not normally need to specify this option because the environment sets it correctly.

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

These options turn off O2 and make O0 (Linux OS and OS X) or Od (Windows OS) the default unless O2 (or higher) is explicitly specified in the same command line.

On Linux* OS and OS X*, specifying the -g or -O0 option sets the -fno-omit-frame-pointer option. On Linux* OS, the -debug inline-debug-info option will be enabled by default if you compile with optimizations (option -O2 or higher) and debugging is enabled (option -g).

Alternate Options

/Zi

Linux and OS X: None

Windows: /debug:full, /debug:all, /debug, or /ZI

See Also


Submit feedback on this help topic