# Zi, Z7, ZI

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

## Syntax

Linux: | See option g.

macOS: | See option g.

Windows: | /Zi /Z7 /ZI

## Arguments

None

## Default

OFF | No debugging information is produced.

## Description

Option /Z7 tells the compiler to generate symbolic debugging information in the object (.obj) file for use with the debugger. No .pdb file is produced by the compiler.

Option /ZI is a synonym for option /Zi.

The /Zi option tells the compiler to generate symbolic debugging information in a program database (PDB) file for use with the debugger. Type information is placed in the .pdb file, and not in the .obj file, resulting in smaller object files in comparison to option /Z7.

When option /Zi is specified, two PDB files are created:

- The compiler creates the program database project.pdb. If you compile a file without a project, the compiler creates a database named vcx0.pdb, where x represents the major version of Visual C++, for example vc140.pdb.

  This file stores all debugging information for the individual object files and resides in the same directory as the project makefile. If you want to change this name, use option /Fd.

- The linker creates the program database executablename.pdb.

  This file stores all debug information for the .exe file and resides in the debug subdirectory. It contains full debug information, including function prototypes, not just the type information found in vcx0.pdb.

Both PDB files allow incremental updates. The linker also embeds the path to the .pdb file in the .exe or .dll file that it creates.

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 option /O2 and make option /Od the default unless option /O2 (or higher) is explicitly specified in the same command line.

For more information about the /Z7, /Zi, and /ZI options, see the Microsoft documentation.

## IDE Equivalent

Visual Studio: General > Generate Debug Information

Eclipse: None

Xcode: None

## Alternate Options

Linux: -g

Windows: None

Parent topic: Output, Debug, and Precompiled Header (PCH) Options

## See Also

Fd compiler option
g compiler option
debug (Windows*) compiler option