Root > Integral parts > Options > Features page > Memory problems page > Enabling memory/resource leaks features for C++ Builder

Enabling memory/resource leaks features for C++ Builder

Previous pageReturn to chapter overviewNext page   

In order to use EurekaLog's memory features (like heap corruption checks or memory leaks detection) or resource leak detection feature in your C++ Builder application - you must perform special setup of your application. Basically, you have to ensure that EurekaLog's EMemLeaks unit is initialized first and finalized last.


Please, follow these steps:

2. (for memory leaks only) Go to "Project" / "Options" / "C++ Linker" and set "Dynamic RTL" option to False.
a. If you are building with dynamic RTL turned on - make sure your project defines _RTLDLL conditional symbol.
b. Do not define _RTLDLL conditional symbol when "Dynamic RTL" option is turned off.
3. (optional, recommended) Go to "Project" / "Options" / "Packages" and set "Build with run-time packages" option to False.
4. Copy EMemLeaksBCB.cpp file to your project folder, if it doesn't exist yet (this file is originally located in \Lib\Common subfolder of your EurekaLog installation).
5. Add EMemLeaksBCB.cpp file from your project's folder to the project.
6. Go to "Project" / "Options" / "Build order" and move EMemLeaksBCB.cpp file to be the first unit (on top).
7. Open project's source ("Project" / "View source") and add USEOBJ("EMemLeaksBCB.cpp") before any USEFORM directives, for example:


#include <vcl.h>
USEOBJ("EMemLeaksBCB.cpp");   // <- added 
#pragma hdrstop
#include <tchar.h>
USEFORM("Unit9.cpp", Form9);


8. Make a full build ("Project" / "Build"); not just compile or make.



See also:



Send feedback... Build date: 2018-11-26
Last edited: 2018-06-14
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.

Permanent link to this article: