Go Up to Using CodeGuard to Debug C++ Applications Index
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 Run > Run 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
- Open either of these dialog boxes:
- Tools > CodeGuard Configuration
- Project > Options > C++ Compiler Debugging
- 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 set CodeGuard compiler options for your project
- Choose Project > Options > C++ Compiler Debugging to display the CodeGuard compiler options.
- Check each of the 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.