Using CodeGuard

From RAD Studio
Jump to: navigation, search

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

  1. Enable the CodeGuard reporting tool.
  2. Enable CodeGuard compiler options for your project.
  3. 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

  1. Open either of these dialog boxes:
  2. Verify that CodeGuard is enabled.
  3. 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

  1. Choose Project > Options > C++ Compiler Debugging to display the CodeGuard compiler options.
  2. Check each of the CodeGuard options to enable full CodeGuard coverage.
  3. Click OK.
  4. 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.

See Also