Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create your "DLL names" automatically when compiling it... ( my way ) >:)

emailx45

Programmer
Jan 10, 2025
6
  • Firstly, the Delphi allow that define some params in your code itself.
  • Second, you can use the options your IDE to define too, but in code it's more flexible...

Code:
library Project1;

uses
  System.SysUtils,
  System.Classes;

// ...

{$R *.res}

// ----------------------------------------------------------------------- //
// automatically change the names when compiling in 32bits/64bits
//
// Define on "DPR" file:
//
{$IFDEF WIN32}
    {$LIBPREFIX 'Hello_'}
    {$LIBSUFFIX '_32bit_'}
    {$LIBVERSION '_World'}

{$ENDIF}
// {$ELSE} ---> if not 32, what it will be?
{$IFDEF WIN64}

    {$LIBPREFIX 'Hello_'}
    {$LIBSUFFIX '_64bit_'}
    {$LIBVERSION '_World'}
{$ENDIF}

//DLL, EXE, etc..
{$EXTENSION 'MyNewExtForProject'}   =  'xxxxxx.MyNewExtForProject'

//
// to another platforms see on HELP about "Compiler Directives"
// ----------------------------------------------------------------------- //

begin
  // ... your code
end.

1736790806755.png
 

Part and Inventory Search

Sponsor

Back
Top