![cppcolors | Embarcadero RAD Studio Delphi C++Builder Blogs](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2020/08/cpp_colors.jpg?resize=1140%2C628&ssl=1)
CodeGuard is a tool for runtime error checking in a C++ application, and catches memory leaks, invalid handles, invalid memory use (such as writing past the end of a buffer), pointer validation, accessing freed memory and resources, and more. If you’ve never used it, check out the list of runtime errors it will find, and potential memory access problems it will warn you about.
An app needs to be specially built to enable CodeGuard instrumentation, and Windows 8 and 10 made a number of changes that prevented CodeGuard from working on those OSes. As of C++Builder 10.2.1, CodeGuard is enabled for Windows 8 and 10.
Many users find CodeGuard a great addition to their toolbox for for runtime debugging, and we hope you’ll be happy to see the feature on Windows 10!
How do I use CodeGuard?
To enable CodeGuard, navigate to the Tools menu, CodeGuard Configuration, and check the “Enable” checkbox. This turns the feature on as a whole. A project needs to be specially built to support CodeGuard, so open your project options, and in C++ Compiler > Debugging ensure “Enable CodeGuard” is checked. Generally, you will want to do this in a debug build only.
Errors will show either in the Messages docked window’s CodeGuard tab, or as a dialog box, depending on the error.
- CodeGuard Overview
- Enabling CodeGuard
- The errors and warnings it will discover
CodeGuard is for the classic Win32 compiler only. (Similar features for the Clang series of compilers are under consideration.)
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition