topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 13, 2024, 11:49 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: How to compile a program to not need any external dll and bpl files  (Read 19130 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
How to compile a BCB program to not need any external dll and bpl files:

When you compile a program in BCB or Delphi that you intend to share or distribute, you either want to include a bunch of required bpl and dll runtime library files, or indicate that the program should compile these into the main program.

Compiling these in will result in a bigger but more portable executable.

There are 2 things you need to set in your project.

  • First, go to the project properties dialog, click on the Linker tab, and UNCHECK the "Use dynamic RTL" checkbox.
  • Second, click on the Packages tab, and UNCHECK the "Build with runtime packages" checkbox at the bottom.

It may also be important to:
  • Third, click on the CodeGuard tab, and UNCHECK the "CodeGruard Validation" checkbox.
« Last Edit: July 26, 2006, 06:35 PM by mouser »

C++Speaker

  • Honorary Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 19
    • View Profile
    • Donate to Member
Also remember to verify You have been successful with
Dependency walker for example:

http://www.dependencywalker.com/

Gianni

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
great link c++speaker! i'm going to blog it in fact.

screenshot:
depwalker_snapshot.png


Dependency Walker is a free utility that scans any 32-bit or 64-bit Windows module (exe, dll, ocx, sys, etc.) and builds a hierarchical tree diagram of all dependent modules. For each module found, it lists all the functions that are exported by that module, and which of those functions are actually being called by other modules. Another view displays the minimum set of required files, along with detailed information about each file including a full path to the file, base address, version numbers, machine type, debug information, and more.

Dependency Walker is also very useful for troubleshooting system errors related to loading and executing modules. Dependency Walker detects many common application problems such as missing modules, invalid modules, import/export mismatches, circular dependency errors, mismatched machine types of modules, and module initialization failures.

Dependency Walker runs on Windows 95, 98, Me, NT, 2000, XP, 2003, and Vista. It can process any 32-bit or 64-bit Windows module, including ones designed for Windows CE. It can be run as graphical application or as a console application. Dependency Walker handles all types of module dependencies, including implicit, explicit (dynamic / runtime), forwarded, delay-loaded, and injected. A detailed help is included.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
I would personally recommend *against* this static linkage - it gives extreme code bloat, makes it impossible for processes to share the memory-hit of the runtime, etc.

Yes, it's a little more bother to redistribute the runtimes, but it's worth it. At the very least offer both static and dynamic linked versions...
- carpe noctem

Eóin

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,401
    • View Profile
    • Donate to Member
I don't want to bring things off topic but I've a question related to distributing runtimes along with a program:- Will you always get the advantage of processes being able to share DLLs or those it only work if the DLLs are placed in the System directory?

I ask because I noticed recently on my PC that I’ve an awful lot of programs with contain say msvcr71.dll or equally popular ones within their own directories. Does windows spot that all these copies are identical and shares the memory or is each one loaded seperatly?

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
I don't want to bring things off topic but I've a question related to distributing runtimes along with a program:- Will you always get the advantage of processes being able to share DLLs or those it only work if the DLLs are placed in the System directory?

I'm afraid it will only share files that have the same image path (whether that be %SYSTEMROOT%\System32, or "common files") - but it's an interesting question and I don't have the definitive answer for that. Somebody should ask the sysinternals guys :)
- carpe noctem