Recent

Author Topic: Ininside ProjectSession, how to target multiples .Dll?  (Read 253 times)

d2010

  • Full Member
  • ***
  • Posts: 230
Ininside ProjectSession, how to target multiples .Dll?
« on: October 30, 2025, 08:48:56 am »
I have two programs [ bin\devcinfo.exe and bin.w32\cecolord.exe]
My project   inside Lazarus.exe
Code: [Select]
cozipinc.lpi
cozipinc.lpr
cozipinc.lps
cozipinc.pom
cozipinc.res
C:Q1=How to multiple target at 
          <Target>
            <Filename Value="c:\Vlaxcompil\bin\cozipinc.dll"/>
            <Filename Value="c:\Vlaxcompil\bin.w32\lazarzip.dll"/>
          </Target>
   isInside file "cozipinc.lps"
?

Both*.exe I used
==devcinfo.exe HAVE
Function cozipinc_htvlaxsrc(exew:word;zn1root,zn2root,AMask:shortstring):eurochar;
external 'cozipinc.dll'
==cecolord.exe HAVE
Function cozipinc_htvlaxsrc(exew:word;zn1root,zn2root,AMask:shortstring):eurochar;
external 'lazarzip.dll'
 ::)
Code: Pascal  [Select][+][-]
  1. Library cozipinc;
  2. {$IFDEF FPC}
  3.   {$MODE Delphi}
  4. {..$optimization autoInline}
  5. {$inline on}
  6. {$modeswitch advancedrecords}
  7.   {$H+}
  8. {$ENDIF}
  9. uses  windows,sysutils,classes,
  10.      fphttpclient,
  11.      h_types in 'c:\Vlaxcompil\Srcincpa\h_types.pas',
  12.      h_aduiport in 'c:\Vlaxcompil\Srcincpa\h_aduiport.pas',
  13.      StrUtils  , //PosEx
  14.      hc_exprecon in 'c:\vlaxcompil\srcincpa\hc_exprecon.pas',
  15.      hc_asiconst In 'c:\vlaxcompil\srcincpa\hc_asiconst.pas',
  16.      hc_Masks in 'c:\Vlaxcompil\srcincpa\hc_Masks.pas',
  17.      LazFileUtils,
  18.      md5, Clipbrd,
  19.      FileUtil,
  20.      zipper;
  21. (* assert_cod(090,'0');
  22.    assert_cod(036,'0');
  23. *)
  24. Const RTSkipBat=5300;
  25.       RT3DONE  =5203;
  26. {$apptype console}
  27. Var cpkunzip_han_openttd:Thandle=00;
  28.     nccdos:array[0..7] of char='B0000='#00#00;
  29.     odutWcMatch:shortstring='*';
  30.     sumo:integer=0;
  31.     AdCharFmt2c:Ansistring='rem:comtine toate sursele Bats';
  32.     AdCharFmt1c:string='rem:contine .DFN';
  33.     wAboutlibLowe:string='';
  34.     wAboutlibGood:integer=0;
  35.     AllttRootNames:string='';
  36.     AllttBatsNames:string='(prompt "Fara subdir si cucuBats")';
  37.     AllttbDclOcx:String='contione fisierele dcl';
  38.     WRegio5AllNames:string='(prompt "contine toate numele fisiere , trebuie pastrat pentru disk32add")';
  39.     WCount5AllNames:record root,deep:integer;end;
  40.     AcZipBoot16Han:handwait=0;
  41.     ret_leay32str:string='';
  42.     ABrchiveFileName:String='';
  43.     kVerbatim_endfmt1c:integer=00;
  44.     netdrv:integer=000; //(<000.You set libCValx from NetDrvPath);
  45.  

« Last Edit: October 30, 2025, 08:58:19 am by d2010 »

n7800

  • Hero Member
  • *****
  • Posts: 542
Re: Ininside ProjectSession, how to target multiples .Dll?
« Reply #1 on: November 03, 2025, 05:37:24 am »
Did I understand correctly that you want your DLL to end up in two places at once after compilation? You can set up a command line that will be executed on every successful build: Project Options > Compiler Options > Compiler Commands > Group "Execute after".

For example, for Windows, you could specify:
Code: Text  [Select][+][-]
  1. C:\Windows\System32\cmd.exe /C "copy bin\cozipinc bin.w32\lazarzip.dll"

I recommend using an absolute path, it will even work with LazBuild.

By the way, don't edit LPS files manually, only the IDE should do that.

n7800

  • Hero Member
  • *****
  • Posts: 542
Re: Ininside ProjectSession, how to target multiples .Dll?
« Reply #2 on: November 03, 2025, 05:46:24 am »
In general, it's best to configure your applications to use the same DLL. Load it dynamically from a relative path, or run the applications from the working directory containing the DLL.

But if these libraries need to be compiled with different options, you'll need to use build modes.

 

TinyPortal © 2005-2018