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.
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:
- Open the runtime package in the IDE and save it as kbmMemRunC103Std.
- Open the designtime package in the IDE and save it as kbmMemDesC103Std.
- Close the package files.
- Open kbmMemDesC103Std.cbproj in notepad.exe or similar editor.
- Locate and delete the line <OutputExt>.dll</OutputExt>
- Save the file and close the editor.
- Open kbmMemRunC103Std in the IDE… Build.
- Open kbmMemDesC103Std in the IDE… Build….Install
Compiling kbmMemTable runtime package for Win64
The C++Builder IDE 64 bit compilation showstopper
- 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.
- Start RAD Studio Command Prompt:
- 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.
20,278 total views, 1 views today
3 thoughts on “C++Builder revelations #1 – Compiling kbmMemTable – IDE crash when compiling in Win64”
I tried to compile this project using the guidelines provided for the 74 bit but get the linker error unresolved external ‘vtable for Kbmmemtable::TkbmMemTable’
Another C++Builder user has reported a problem that while not using kbmMemTable, it exhibits same error, and a solution for it.
I have just spend time (too much) on setting C++Builder 10.4.2 up to compile kbmMemTable for Win64 and link a simple project with it. As long as one is following the instructions in the blog, and makes sure to setup your own project to compile and link with the appropriate settings (matching paths, target compiler etc. and matching compilation for using runtime libraries or not), then it will link.
C++Builder is however a PITA to work with IMO. Not because of C++Builder in itself, but because as a C++ developer you have to extremely careful about referencing the correct paths and files, and since there are so many of them, there is a real chance of referencing wrong ones.
I only recommend using C++Builder if you really have no other choice, because you would be so much more productive using Delphi.
The complete simple project can be downloaded from here (I used kbmMemTable Pro in this case, but replacing the text Pro with Std at relevant places within the project files, it will work as well with kbmMemTable Standard Edition).