Root > Basic procedures > Configuring project itself > Configuring C++ Builder project for EurekaLog

Configuring C++ Builder project for EurekaLog

Previous pageReturn to chapter overviewNext page   

We highly recommend that you perform the following setup in order to configure your C++ project for EurekaLog.

 

 

1. Configuring memory and resource features

First, you have to ensure that EurekaLog's EMemLeaks/EResLeaks units are initialized first and finalized last. Please, follow these steps:

2. 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"). In other words, open your main .cpp file (the one with your main function).
8. Add USEOBJ("EMemLeaksBCB.cpp") before any USEFORM directives, for example:

 

//---------------------------------------------------------------------------
 
USEOBJ("EMemLeaksBCB.cpp");   // <- ADDED 
#include <vcl.h>
#pragma hdrstop
#include <tchar.h>
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", Form1);
//---------------------------------------------------------------------------
...

 

 

2. Configuring C++ specifics

Second, install the C++-specific hooks:

1. (optional, highly recommended) Enable the "C++ Compiler" / "Use 'classic' Borland compiler" option.
2. Again, open project's source ("Project" / "View source"). In other words, open your main .cpp file (the one with your main function).
3. Add EMemLeaks.hpp and the EurekaLogInstallCpp() line, for example:

 

//---------------------------------------------------------------------------
 
USEOBJ("EMemLeaksBCB.cpp");   
#include <EMemLeaksBCB.hpp>   // <- ADDED
#include <vcl.h>
#pragma hdrstop
#include <tchar.h>
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", Form1);
//---------------------------------------------------------------------------
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
{
   EurekaLogInstallCpp(); // <- ADDED
   try
   {
      Application->Initialize();
      Application->MainFormOnTaskBar = true;
...

 

 

3. Configuring project options

Third, setup your project options for maximum debugging.

 

 

4. Building your project

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

 

Important: C++ Builder's .map file does not contain any line numbers whatsoever:

a. [C++ Builder, 32 bit] EurekaLog uses Turbo Debugger debug information (aka TD32 info) to restore line numbers for C++ Builder projects. That is why generation of TD32 info should be enabled in your linker options.
b. [C++ Builder, 64 bit] 64-bit C++ Builder does not use TD32. It is build on entirely new framework: LLVM, which uses DWARF debug format. Currently EurekaLog is unable to use this information.

 

 

See also:




Send feedback... Build date: 2024-09-30
Last edited: 2024-06-03
PRIVACY STATEMENT
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: https://www.eurekalog.com/help/eurekalog/configuring_cppbuilder.php