Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile Delphi component package (bpl) for different Delphi versions

The situation is the following. Typically I use RAD Studio 2010 for Delphi development. I have some components I would like to redistribute in binary form (*.bpl without source). But I would like people to be able to use them despite of their Delphi version. But, for example, dcu files can be used only by compiler version, which generated them. Almost the same situation is with bpl files as I know. Every bpl file will require corresponding VCLXX.bpl library depending on Delphi version. How do I make my bpls, compiled in 2010 to be able to be used in Delphi7, 2007 etc?

Is the only solution to have ALL Delphi versions installed and compile bpl files separately in each?

like image 598
Vladislav Rastrusny Avatar asked Jan 26 '10 22:01

Vladislav Rastrusny


2 Answers

Yes, that's the only solution. Each compiler produces DCUs and BPLs specific to it's own version. The only exception I'm aware of is that Delphi 2006 and 2007 share the same format.

like image 148
Mason Wheeler Avatar answered Sep 18 '22 21:09

Mason Wheeler


To distribute compiled code that can be used by multiple compiler versions, distribute an ordinary DLL, not a BPL. Packages and units are version-specific.

Create standalone functions that you export in the C style, or create COM objects that get registered with the OS.

It doesn't have to change your entire development strategy, though; it could be a DLL that uses the BPL, so you can keep all the work you've already put into the package.

like image 28
Rob Kennedy Avatar answered Sep 17 '22 21:09

Rob Kennedy