Jump to content
araujoarthur

Is it possible to compile a dynamic linked library in one Delphi version and use it in older versions?

Recommended Posts

I'm aware that packages must be compiled with the same major version of the language as the project you intend to use in order to be imported into the project, but what about dynamic linked libraries? Can I write and compile a DLL in Delphi 12 and use it in Delphi 10.3 for example? Also, about the opposite, can I use a DLL compiled in Delphi 10.3 and use in a Delphi 12 project?

Share this post


Link to post

Yes, for the most part, a plain DLL can do that. Just be careful about accessing anything across the DLL boundary that is version-specific. Keep the interface between DLL and EXE simple - stick to functions and simple POD types or OS-managed types only. No classes, no Delphi-managed types, etc.

  • Like 2

Share this post


Link to post

I'm 100% not an expert on DLLs ... but I know people have even used Delphi compiled Dlls with eg C# applications.

(Maybe it would be best to imagine a D10 vs D12 as being incompatible to that sort of degree?)

Share this post


Link to post
1 hour ago, pmcgee said:

I'm 100% not an expert on DLLs ... but I know people have even used Delphi compiled Dlls with eg C# applications.

And vice versa. But doing so works safely and reliably only if you stick to certain rules to ensure compatibility across programming languages/ABIs, environments, etc. Which limits what you can and can't use across the DLL boundary. 

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×