Configuring Debug Mode for Applications in the Visual Studio* IDE

Before building applications in debug mode, configure debug mode with the optimal compiler and linker settings to produce the most accurate and complete results:

Compiler/Linker Property

Correct C/C++ Setting

Correct Fortran Setting

Impact If Not Set Correctly

Debug information

Enabled (/Zi or /ZI)

Enabled (/debug:full)

Missing file/line information

Optimization

Disabled (/Od)

Disabled (/Od)

Incorrect file/line information

Dynamic runtime library

Selected (/MD or /MDd)

Selected (/libs:dll/threads or libs:dll/threads/dbglibs )

False positives or missing code locations

Basic runtime error checks

Disabled (do not use /RTC; Default option in Visual Studio* IDE)

None (/check:none)

False positives

Configure Debug Mode for C/C++ Applications

  1. Right-click the project in the Solution Explorer to display a context menu, then choose Properties to display the Property Pages dialog box.

  2. In the Configuration drop-down list, choose Debug.

  3. In the left pane, choose Configuration Properties > C/C++.

    • Choose General and verify the Debug Information Format field is set to Program Database (/Zi) or Program Database for Edit & Continue (/ZI).

    • Choose Optimization and verify the Optimization field is set to Disabled (/Od).

    • Choose Code Generation. Verify the Runtime Library field is set to Multi-threaded DLL (/MD) or Multi-threaded Debug DLL (/MDd) and the Basic Runtime Checks field is set to Default.

  4. In the left pane, choose Configuration Properties > Linker > Debugging and verify the Generate Debug Info field is set to Yes (/DEBUG).

  5. Click the OK button to close the dialog box.

Configure Debug Mode for Fortran Applications

  1. Right-click the project in the Solution Explorer to display a context menu, then choose Properties to display the Property Pages dialog box.

  2. In the Configuration drop-down list, choose Debug.

  3. In the left pane, choose Configuration Properties > Fortran.

    • Choose Debugging and verify the Debug Information Format field is set to Full (/debug:full).

    • Choose Optimization and verify the Optimization field is set to Disable (/Od).

    • Choose Libraries and verify the Runtime Library field is set to Multithread DLL (/libs:dll/threads) or Debug Multithread DLL (libs:dll/threads/dbglibs).

    • Choose Run-time and verify the Runtime Error Checking field is set to None (/check:none).

  4. In the left pane, choose Configuration Properties > Linker > Debugging and verify the Generate Debug Info field is set to Yes (/DEBUG).

  5. Click the OK button to close the dialog box.

See Also


Supplemental documentation specific to a particular Intel Studio may be available at <install-dir>\<studio>\documentation\ .

For more complete information about compiler optimizations, see our Optimization Notice.