C++Builder revelations #1 – Compiling kbmMemTable – IDE crash when compiling in Win64

This blog post contains both a fix for compiling kbmMemTable in pure C++Builder personality in newer C++Builder versions (10.x.x – tested with 10.3.3), and a showstopper bug in the IDE when opening it with C++Builder only personality, and compiling kbmMemTable Runtime package in C++Builder 10.3.3 (no Delphi personality) for Win64.

Preface

Because of the growing complexity of compiling packages in C++Builder, I have only occationally updated the C++Builder only projects for kbmMW and kbmMemTable, and instead realied on the Delphi personality, which I always recommend people to also have when using C++Builder, simply because C++Builder is a “bastard” compared to Delphi which is the true 1.st citizen compiler in the IDE. It just simplifies many things, also when being a C++ only developer to have the Delphi personality included.

This has worked out seemingly quite well for several years, either indicating that most that do code using C++Builder, have bought RAD studio including the Delphi personality, or indicating that only very few are actually using C++Builder with kbmMemTable.

However recently a kbmMemTable user contacted me. He had difficulties getting kbmMemTable compiled and installed in his C++Builder only environment.

After some mails forth and back, it seems that we have found a solution for the issues he encounters during compilation. It is those solutions I will describe in this blogpost.

The kbmMemTable project issue

The kbmMemTable installer comes with a C++Builder Seattle project file. To use it in C++Builder 10.3.3 (and probably 10.3.x) do the following:

  1. Open the runtime package in the IDE and save it as kbmMemRunC103Std.
  2. Open the designtime package in the IDE and save it as kbmMemDesC103Std.
  3. Close the package files.
  4. Open kbmMemDesC103Std.cbproj in notepad.exe or similar editor.
  5. Locate and delete the line <OutputExt>.dll</OutputExt>
  6. Save the file and close the editor.
  7. Open kbmMemRunC103Std in the IDE… Build.
  8. Open kbmMemDesC103Std in the IDE… Build….Install
Now you should have a nicely installed kbmMemTable instance in your C++Builder only personality.
Providing you setup your source paths/library paths correctly, you can easily compile your C++ only projects containing kbmMemTable.
This leads us to the next issue.

Compiling kbmMemTable runtime package for Win64

The C++Builder IDE 64 bit compilation showstopper

The first step to make, is adding the Windows 64 bit target to the package. It will go fine.
  1. Open the kbmMemRunC103Std package in the IDE. Add the Win64 target.

    Usually you would then just build the package and be happy. Unfortunately doing that, crashes the IDE without warning after a short while. Debugging into it, it seems to be at a place where the IDE is attempting to collect the number of lines compiled. It actually ends up having generated all headerfiles, and object files, but not the final .a (archive) file.

    The workaround is to compile from the command line.

  2. Start RAD Studio Command Prompt:

  3. In the Cmd.exe like window, type:

    msbuild kbmMemRunC103Std.cbproj /t:Build /p:config=Debug /p:platform=Win64

Now everything will compile correctly and the .a file will be available for later linking when you compile your 64 bit application.

 

 12,805 total views,  1 views today

Author: kimbomadsen

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.