How to deal with dependencies (DLL's) in Delphi / Lazarus?

4
  • How do I find out which DLL's should I distribute along with my application so that it works on any machine?

  • I know InstallShield - it does the business in an automated way - but I would like to know if there is any free way to do this, even though manual?

  • And another question: Is it enough to include the DLL's in the same folder as my application's executable or DLL's that need to be included in other folders to System32 , for example)?

asked by anonymous 14.04.2014 / 13:31

2 answers

3

The normal thing is that you know which dlls your software depends on. It does not make sense for your software to depend on a dll and you, as a programmer not knowing it.

Some options however are:

  • In Delphi, during the debugging of your program, you can use the View menu - > Debug Windows - > Modules. It shows all the dlls loaded.
  • As mentioned in the answer by DBX8 you can use DependencyWalker .
  • At the command prompt ( cmd ) use the command tasklist /m . It will list all the dlls used by each specific program being executed.
  • A related question in the OS is this: link

        
    16.04.2014 / 19:01
    3
      

    How do I find out which DLL's I should distribute together   with my application so that it works on any machine?

         

    I know InstallShield - it does the business in an automated way, but I'd like to   know if there is any free way to do this, even if manual?

    The Dependency Walker seems to be a good utility for this.

    Some features:

    • Free
    • Available for Windows 95, 98, Me, NT, 2000, XP, 2003, Vista, 7 and 8
    • It can process any Windows 32 bits or 64 bits, including those developed for Windows CE

      

    ItissufficienttoincludetheDLLsinthesamefolderasthe  executableofmyapplicationorthereareDLL'sthatneedtobeincluded  inotherfolders(suchasSystem32,forexample)?

    Thiswilldependalotonthepurposeofyourapplication,butit'sbesttoputtheDLLsinthesamefolderastheexecutable,useotherfolderslikeSystem32willprobablycreateadeadlockwiththeuserpermissions( UAC ). A good place to store your application data is in the AppData .

    How to mentioned by EMBarbosa , avoiding the use of the System32 folder can also save you from problems like DLL Hell .

        
    16.04.2014 / 02:27