How can I use the port for Borland C ++ builder for Linux?

I have source code for a Windows DLL written in C ++ using the Visual Component Library. Now my task is to port this to Linux, but I don’t have the source code for VCL itself or any documentation (and I never worked with Borland C ++, in my days of Windows I used MFC).

This should not be so difficult, since there is no GUI in my DLL: as far as I can tell, it uses VCL for multithreading. I came across a class that inherits from TThread, and that is where I am stuck. I did a search on the Internet, but have not yet found documentation for VCL. I would like not to buy a book on Borland C ++ Builder, because I don’t have time to wait for it to arrive with Amazon. I can’t buy a package for Windows because at work I only have a Linux box.

Any suggestions?

+4
source share
6 answers

VCL is documented on the CodeGear website . In particular, TThread is described here .

I found the documentation on thread-related VCL components quite rare. This site has a much better description of the Delphi / VCL streaming approach.

+3
source

The Boost and wxWidgets libraries will provide analogues to the VCL classes.

+6
source

You should know that the VCL used by C ++ Builder is completely written in Delphi / ObjectPascal. All C ++ builder applications use C ++ using delphi-based libraries.

The open source project FreePascal / Lazarus implements the reversed majority of VCL (almost all non-visual materials and most visual materials), and it runs on Linux. Non-visual VCL-compatible material is known as the “Free Component Library” (“FCL”) http://www.freepascal.org/ http://www.freepascal.org/fcl/fcl.var

The source of the TThread implementation in FCL should be fairly easy to find.

One option is to rewrite it in FreePascal, where the language changes to ObjectPascal, but the VCL calls and the use of the VCL components will be almost identical.

Another option would be to switch to C ++ on Linux and somehow use FreePascal VCL from C ++. I am not sure about the practicality / feasibility of this. Someone on the FreePascal forums should be able to answer that.

Thus, another option, as someone mentioned, is simply to rewrite using another thread library.

+5
source

You can download their free compiler and try experimenting with it. It should be possible to run it under WINE at least. Perhaps even in FreeDOS.

It must be associated with the TThread class in Delphi / Kylix. This is another alternative to study it. I really believe that the most important methods were executed () and sync (), but that has been centuries since I used it.

However, if you plan on porting code cleanly to Linux, this may help reimplement the TThread class yourself, using some acceleration libraries or something like that.

+2
source

Many years ago, Borland released a version of its IDE for Linux, sold as Kylix . I'm not sure if this is supported, but it may be the path of least resistance for you.

+2
source

There are several libraries that provide frameworks such as streams, for example. Boost (www.boost.org) or ACE ( http://www.cs.wustl.edu/~schmidt/ACE.html )

Simply porting the code to use one of these streaming infrastructures is enough.

+1
source

All Articles