This procedure describes how to use CodeGuard when debugging a C++ application.
To run a C++ application with CodeGuard reporting
- Enable the CodeGuard reporting tool.
- Enable CodeGuard compiler options for your project.
- Choose RunRun to run your application.
During the execution of your application, CodeGuard runtime errors appear in the
Message view.
CodeGuard also generates an error log named <project_name>.cgl that lists any errors it finds. The error log is located in the same directory as your executable.
Note: If you suspect that your program accesses a freed memory block but CodeGuard does not report an error, increase the value of Maximum memory block size
or
Delay queue length on the
Resource Options page of the
Configure CodeGuard dialog box.
To enable the CodeGuard reporting tool
- Choose ToolsCodeGuard Configuration to display the CodeGuard Configuration dialog box.
- Verify that CodeGuard is enabled.
- Click OK.
Note: If you change any CodeGuard settings in the CodeGuard Configuration
dialog box, CodeGuard generates a
.cgi configuration file with the same name and directory as your project file.
To enable CodeGuard compiler options for your project
- Choose ProjectOptionsC++ CompilerDebugging to display the CodeGuard compiler options.
- Check Enable all CodeGuard options to enable full CodeGuard coverage.
- Click OK.
- Rebuild your project.
Note: If you compile and link your project in separate steps, remember to include the CodeGuard library (cg32.lib
) before including other libraries.